summaryrefslogtreecommitdiff
path: root/ext/standard/tests/array/extract_error.phpt
blob: 08e1824b0fb301416e7007bf34b2a6bf5ffd7ead (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
--TEST--
Test extract() function (error conditions)
--FILE--
<?php

/* Testing Error Conditions */
echo "*** Testing Error Conditions ***\n";

/* Invalid second argument ( only 0-6 is valid) */
$arr = array(1);
var_dump( extract($arr, -1 . "wddr") );
var_dump( extract($arr, 7 , "wddr") );

/* Two Arguments, second as prefix but without prefix string as third argument */
var_dump( extract($arr,EXTR_PREFIX_IF_EXISTS) );

echo "Done\n";
?>
--EXPECTF--
*** Testing Error Conditions ***

Notice: A non well formed numeric value encountered in %s on line %d

Warning: extract(): Invalid extract type in %s on line %d
NULL

Warning: extract(): Invalid extract type in %s on line %d
NULL

Warning: extract(): specified extract type requires the prefix parameter in %s on line %d
NULL
Done