[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 <zoeslam@gmail.com>
Signed-off-by: Filippo Tessarotto <zoeslam@gmail.com>
3c31580 to
e330333
Compare
Signed-off-by: Filippo Tessarotto <zoeslam@gmail.com>
Ocramius
left a comment
There was a problem hiding this comment.
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.
|
|
||
| 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.
Oh wow, these were changed by CS? :O
There was a problem hiding this comment.
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. |
weierophinney
left a comment
There was a problem hiding this comment.
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 <matthew@weierophinney.net> Signed-off-by: Filippo Tessarotto <zoeslam@gmail.com>
Signed-off-by: Filippo Tessarotto <zoeslam@gmail.com>
a387ed9 to
d844fcf
Compare
0d68392 to
724894b
Compare
Description
In our app we serialize
Laminas\Session\Storage\ArrayStorageobjects as defined in its package:https://github.com/laminas/laminas-session/blob/2.12.0/src/Storage/ArrayStorage.php
Which uses
ArrayObject::ARRAY_AS_PROPSalongside a protected property$isImmutable.Such serialization broke after #35 has been released in
3.6minor.The proposed test indeed passes on
3.5.xbranch.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.