Fix #49649 - Handle property visibility changes on unserialization#2494
Closed
pmmaga wants to merge 1 commit into
Closed
Fix #49649 - Handle property visibility changes on unserialization#2494pmmaga wants to merge 1 commit into
pmmaga wants to merge 1 commit into
Conversation
Contributor
Author
|
Rebased on fresh master and solved the conflicts. Travis failure is unrelated. |
Member
|
Merged 7cb5bdf Thanks. |
madmajestro
added a commit
to madmajestro/igbinary
that referenced
this pull request
May 4, 2026
If the visibility of a property has changed between serialization and unserialization, or if a private or protected property needs to be restored, but the serialized data was generated by a __serialize method while no __unserialize method exists in the class, the property value cannot be found during hydration in the object's hash table. The reason for this is that in these cases the property name in the serialized representation does not match the prefixed/mangled property name of the current class definition. To resolve this, an attempt is made to determine the correctly prefixed property name by performing a lookup with the unprefixed property name in the properties_info hash table of the class. The implementation is borrowed from the current version of php-src/ext/standard/var_unserializer.re to align the behavior to the serializer of PHP >= 7.2. See 7cb5bdf64a95bd70623d33d6ea122c13b01113bd / php/php-src#2494 for the initial implementation in PHP 7.2.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Link for bugsnet: https://bugs.php.net/bug.php?id=49649
It shouldn't have any BC breaking effects. Any feedback on the implementation is welcome.