Fix #66084: whitespace depending iteration over SimpleXMLElements #1306
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This patch is supposed to solve whitespace depending irregularities when iterating over SimpleXMLElements where sxe.iter_type == SXE_ITER_NONE. The faulty behavior may affect var_dump, print_r, json_encode, etc.
Of course, the patch addresses the duplicates #62639, #67116, #69169, #69491, #61335 and #67572 as well; nonetheless there are separate tests included, based on the respective test scripts, for each of the mentionend reports. Tests for #66084 had already been merged.
I've tested the patch on Windows 7 (libxml2 2.9.2) and Ubuntu 14.04 LTS (libxml2 2.7.7, 2.7.8, 2.8.0, 2.9.1 and 2.9.2) with PHP 5.5.25, PHP 5.6.9 and master (7dac4d4). Before applying the actual patch the 6 new tests failed; after applying the patch all tests in ext/simplexml/tests passed,except very few tests which also did not pass without the patch: SimpleXMLElement_xpath.phpt and bug37565.phpt on Windows with PHP 5, and SimpleXMLElement_xpath.phpt on Ubuntu (skipped due to requiring 32-bit build) with master.
It has to be noted that commit 18f9589 is not relevant for PHP 5, but only for current master.