-
-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[3.6] Regression: ArrayObject with protected ARRAY_AS_PROPS cannot be serialized anymore #39
[3.6] Regression: ArrayObject with protected ARRAY_AS_PROPS cannot be serialized anymore #39
Conversation
8950302
to
3c31580
Compare
… serialized anymore Signed-off-by: Filippo Tessarotto <[email protected]>
Signed-off-by: Filippo Tessarotto <[email protected]>
3c31580
to
e330333
Compare
Signed-off-by: Filippo Tessarotto <[email protected]>
Signed-off-by: Filippo Tessarotto <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have the context to review this, sorry.
I'd defer to @weierophinney, but you can pretty much assume that the BC break is not intentional, so a 3.6.x
release is very much welcome, if it fixes the BC issue.
@@ -92,7 +92,7 @@ public function __isset($key) | |||
} | |||
|
|||
if (in_array($key, $this->protectedProperties)) { | |||
throw new Exception\InvalidArgumentException('$key is a protected property, use a different key'); | |||
throw new Exception\InvalidArgumentException("$key is a protected property, use a different key"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh wow, these were changed by CS? :O
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's 8 years these LoC are here in this very form 😄
Here's the bug explained: child class properties are serialized before parent's ones. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a tricky order of operations issue, and you're correct; the change was unintentional.
I've got a suggestion for your proposed solution which should also remove some of the new Psalm errors that were introduced.
Co-authored-by: Matthew Weier O'Phinney <[email protected]> Signed-off-by: Filippo Tessarotto <[email protected]>
Signed-off-by: Filippo Tessarotto <[email protected]>
a387ed9
to
d844fcf
Compare
Signed-off-by: Filippo Tessarotto <[email protected]>
0d68392
to
724894b
Compare
Description
In our app we serialize
Laminas\Session\Storage\ArrayStorage
objects as defined in its package:https://github.com/laminas/laminas-session/blob/2.12.0/src/Storage/ArrayStorage.php
Which uses
ArrayObject::ARRAY_AS_PROPS
alongside a protected property$isImmutable
.Such serialization broke after #35 has been released in
3.6
minor.The proposed test indeed passes on
3.5.x
branch.I hope to find a fix soon, in the meantime I'd like to know if such BC Break was intended or not, ping @weierophinneySurely a BC Break that deserves a bugfix release, imho.