Annotation of embedaddon/php/Zend/tests/007.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: each() tests
3: --FILE--
4: <?php
5:
6: var_dump(each());
7: $var = 1;
8: var_dump(each($var));
9: $var = "string";
10: var_dump(each($var));
11: $var = array(1,2,3);
12: var_dump(each($var));
13: $var = array("a"=>1,"b"=>2,"c"=>3);
14: var_dump(each($var));
15:
16: $a = array(1);
17: $a [] =&$a[0];
18:
19: var_dump(each($a));
20:
21:
22: echo "Done\n";
23: ?>
24: --EXPECTF--
25: Warning: each() expects exactly 1 parameter, 0 given in %s on line %d
26: NULL
27:
28: Warning: Variable passed to each() is not an array or object in %s on line %d
29: NULL
30:
31: Warning: Variable passed to each() is not an array or object in %s on line %d
32: NULL
33: array(4) {
34: [1]=>
35: int(1)
36: ["value"]=>
37: int(1)
38: [0]=>
39: int(0)
40: ["key"]=>
41: int(0)
42: }
43: array(4) {
44: [1]=>
45: int(1)
46: ["value"]=>
47: int(1)
48: [0]=>
49: string(1) "a"
50: ["key"]=>
51: string(1) "a"
52: }
53: array(4) {
54: [1]=>
55: int(1)
56: ["value"]=>
57: int(1)
58: [0]=>
59: int(0)
60: ["key"]=>
61: int(0)
62: }
63: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>