Skip to content

Commit 418ec50

Browse files
authored
ext/simplexml: Document that get methods and string casts no longer implicitly rewind (#5737)
1 parent 371e92c commit 418ec50

2 files changed

Lines changed: 23 additions & 0 deletions

File tree

reference/simplexml/simplexmlelement.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,18 @@
5656
</row>
5757
</thead>
5858
<tbody>
59+
<row>
60+
<entry>8.4.0</entry>
61+
<entry>
62+
Get methods (such as
63+
<methodname>SimpleXMLElement::asXML</methodname> or
64+
<methodname>SimpleXMLElement::getName</methodname>) and casting a
65+
<classname>SimpleXMLElement</classname> to a &string; no longer
66+
implicitly rewind the iterator.
67+
The iterator must now be rewound explicitly, using
68+
<methodname>SimpleXMLElement::rewind</methodname>, where needed.
69+
</entry>
70+
</row>
5971
<row>
6072
<entry>8.0.0</entry>
6173
<entry>

reference/simplexml/simplexmlelement/rewind.xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,17 @@
2222
<para>
2323
This method rewinds the <classname>SimpleXMLElement</classname> to the first element.
2424
</para>
25+
26+
<note>
27+
<simpara>
28+
As of PHP 8.4.0, calling get methods (such as
29+
<methodname>SimpleXMLElement::asXML</methodname> or
30+
<methodname>SimpleXMLElement::getName</methodname>) or casting a
31+
<classname>SimpleXMLElement</classname> to a &string; no longer
32+
implicitly rewinds the iterator. Where required, the iterator must be
33+
rewound explicitly by calling this method.
34+
</simpara>
35+
</note>
2536
</refsect1>
2637

2738
<refsect1 role="parameters">

0 commit comments

Comments
 (0)