Annotation of embedaddon/php/ext/spl/tests/recursive_tree_iterator_005.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: SPL: RecursiveTreeIterator and binary vs unicode (PHP 6.0+)
3: --INI--
4: error_reporting=E_ALL&~E_NOTICE
5: --FILE--
6: <?php
7:
8: $ary = array(
9: 0 => array(
10: (binary) "binary",
11: "abc2",
12: 1,
13: ),
14: (binary) "binary" => array(
15: 2,
16: "b",
17: 3 => array(
18: 4,
19: "c",
20: ),
21: "4abc" => array(
22: 4,
23: "c",
24: ),
25: ),
26: );
27:
28: $it = new RecursiveTreeIterator(new RecursiveArrayIterator($ary), 0);
29: foreach($it as $k => $v) {
30: var_dump($v);
31: }
32: echo "\n----------------\n\n";
33: foreach($it as $k => $v) {
34: var_dump($k);
35: }
36: echo "\n----------------\n\n";
37: echo "key, getEntry, current:\n";
38: foreach($it as $k => $v) {
39: var_dump($it->key(), $it->getEntry(), $it->current());
40: }
41: ?>
42: ===DONE===
43: --EXPECT--
44: string(7) "|-Array"
45: string(10) "| |-binary"
46: string(8) "| |-abc2"
47: string(5) "| \-1"
48: string(7) "\-Array"
49: string(5) " |-2"
50: string(5) " |-b"
51: string(9) " |-Array"
52: string(7) " | |-4"
53: string(7) " | \-c"
54: string(9) " \-Array"
55: string(7) " |-4"
56: string(7) " \-c"
57:
58: ----------------
59:
60: string(3) "|-0"
61: string(5) "| |-0"
62: string(5) "| |-1"
63: string(5) "| \-2"
64: string(8) "\-binary"
65: string(5) " |-0"
66: string(5) " |-1"
67: string(5) " |-3"
68: string(7) " | |-0"
69: string(7) " | \-1"
70: string(8) " \-4abc"
71: string(7) " |-0"
72: string(7) " \-1"
73:
74: ----------------
75:
76: key, getEntry, current:
77: string(3) "|-0"
78: string(5) "Array"
79: string(7) "|-Array"
80: string(5) "| |-0"
81: string(6) "binary"
82: string(10) "| |-binary"
83: string(5) "| |-1"
84: string(4) "abc2"
85: string(8) "| |-abc2"
86: string(5) "| \-2"
87: string(1) "1"
88: string(5) "| \-1"
89: string(8) "\-binary"
90: string(5) "Array"
91: string(7) "\-Array"
92: string(5) " |-0"
93: string(1) "2"
94: string(5) " |-2"
95: string(5) " |-1"
96: string(1) "b"
97: string(5) " |-b"
98: string(5) " |-3"
99: string(5) "Array"
100: string(9) " |-Array"
101: string(7) " | |-0"
102: string(1) "4"
103: string(7) " | |-4"
104: string(7) " | \-1"
105: string(1) "c"
106: string(7) " | \-c"
107: string(8) " \-4abc"
108: string(5) "Array"
109: string(9) " \-Array"
110: string(7) " |-0"
111: string(1) "4"
112: string(7) " |-4"
113: string(7) " \-1"
114: string(1) "c"
115: string(7) " \-c"
116: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>