From a811ff39eb3d858e3fde3b99600230938686ebf3 Mon Sep 17 00:00:00 2001 From: Louis-Arnaud Date: Fri, 10 Jul 2026 12:13:10 +0200 Subject: [PATCH] ext/simplexml: Document that get methods and string casts no longer implicitly rewind --- reference/simplexml/simplexmlelement.xml | 12 ++++++++++++ reference/simplexml/simplexmlelement/rewind.xml | 11 +++++++++++ 2 files changed, 23 insertions(+) diff --git a/reference/simplexml/simplexmlelement.xml b/reference/simplexml/simplexmlelement.xml index 244271b92601..7d901c0388b2 100644 --- a/reference/simplexml/simplexmlelement.xml +++ b/reference/simplexml/simplexmlelement.xml @@ -56,6 +56,18 @@ + + 8.4.0 + + Get methods (such as + SimpleXMLElement::asXML or + SimpleXMLElement::getName) and casting a + SimpleXMLElement to a &string; no longer + implicitly rewind the iterator. + The iterator must now be rewound explicitly, using + SimpleXMLElement::rewind, where needed. + + 8.0.0 diff --git a/reference/simplexml/simplexmlelement/rewind.xml b/reference/simplexml/simplexmlelement/rewind.xml index 8caf94997d8f..1a73c2710751 100644 --- a/reference/simplexml/simplexmlelement/rewind.xml +++ b/reference/simplexml/simplexmlelement/rewind.xml @@ -22,6 +22,17 @@ This method rewinds the SimpleXMLElement to the first element. + + + + As of PHP 8.4.0, calling get methods (such as + SimpleXMLElement::asXML or + SimpleXMLElement::getName) or casting a + SimpleXMLElement to a &string; no longer + implicitly rewinds the iterator. Where required, the iterator must be + rewound explicitly by calling this method. + +