1 | <?php |
||
13 | class XMLIterator implements IteratorInterface |
||
14 | { |
||
15 | /** |
||
16 | * @var XMLReader |
||
17 | */ |
||
18 | protected $reader; |
||
19 | |||
20 | /** |
||
21 | * @var int |
||
22 | */ |
||
23 | private $index; |
||
24 | |||
25 | /** |
||
26 | * @var bool |
||
27 | */ |
||
28 | private $lastRead; |
||
29 | |||
30 | /** |
||
31 | * @var array |
||
32 | */ |
||
33 | private $elementStack; |
||
34 | |||
35 | 16 | public function __construct(XMLReader $reader) |
|
39 | |||
40 | /** |
||
41 | * @return XMLReader |
||
42 | */ |
||
43 | public function getReader() : XMLReader |
||
47 | |||
48 | /** |
||
49 | * @param string $name |
||
50 | * |
||
51 | * @return bool|Node |
||
52 | */ |
||
53 | 8 | public function moveToNextElementByName($name = null) |
|
65 | |||
66 | 8 | public function moveToNextElement() |
|
70 | |||
71 | /** |
||
72 | * @param int $nodeType |
||
73 | * |
||
74 | * @return bool|Node |
||
75 | */ |
||
76 | 8 | public function moveToNextByNodeType($nodeType) |
|
94 | |||
95 | /** |
||
96 | * @inheritdoc |
||
97 | */ |
||
98 | 16 | public function rewind() |
|
109 | |||
110 | /** |
||
111 | * @inheritdoc |
||
112 | */ |
||
113 | 16 | public function valid() |
|
117 | |||
118 | /** |
||
119 | * @return Node |
||
120 | */ |
||
121 | 13 | public function current() |
|
125 | |||
126 | /** |
||
127 | * @inheritdoc |
||
128 | */ |
||
129 | 7 | public function key() |
|
133 | |||
134 | /** |
||
135 | * @inheritdoc |
||
136 | */ |
||
137 | 16 | public function next() |
|
150 | |||
151 | /** |
||
152 | * @return string |
||
153 | */ |
||
154 | public function getNodePath() : string |
||
158 | |||
159 | /** |
||
160 | * @return string |
||
161 | */ |
||
162 | public function getNodeTree() : string |
||
174 | } |
||
175 |
In PHP, under loose comparison (like
==
, or!=
, orswitch
conditions), values of different types might be equal.For
string
values, the empty string''
is a special case, in particular the following results might be unexpected: