Make var_export/debug_zval_dump first check for infinite recursion on the object before properties #8045
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 test case previously failed with an assertion error in debug builds
(for updating an index of the array to set it to the same value it already had)
After the new check on recursion on the object, repeat the existing check on the return value of
get_properties_for
in case there was a reason for doing it that way.
HT_ASSERT_RC1(ht);
would fail for SplFixedArray and relateddatastructures.
In order for a native datastructure to correctly implement
*get_properties_for
for var_export's cycle detection,it would need to return the exact same array every time prior to this PR.
This would prevent SplFixedArray or similar classes from returning a
temporary array that
Note that SplFixedArray continues to need to return
object->properties
until php 9.0, when dynamic properties are forbidden.
(to display dynamic properties when debugging, until then)
Closes GH-8044