Fix GH-12695: skip __get() when __isset() materialised the property#22181
Conversation
2ccd3b3 to
1c11fe3
Compare
iluuu1994
left a comment
There was a problem hiding this comment.
Looks functionally correct. I'd be happy merging this to master if the rest of internals are happy.
1c11fe3 to
5d92fdc
Compare
arnaud-lb
left a comment
There was a problem hiding this comment.
This looks right to me otherwise
5d92fdc to
0e4cd8a
Compare
0e4cd8a to
c47e4ec
Compare
iluuu1994
left a comment
There was a problem hiding this comment.
Thanks! LGTM. Given this is on verge of bug and feature, it would be good to post on the list again in a separate thread about this PR, and clarify that this is proposed to be merged unless there are objections. We usually wait for at least 2 weeks for such changes to be merged. If there are concerns, this will need to go through the RFC process nonetheless.
TimWolla
left a comment
There was a problem hiding this comment.
Only looked at the tests and NEWS/UPGRADING. I trust the implementation review of Arnaud and Ilija.
c47e4ec to
70aaed7
Compare
|
Almost two weeks and no pushback on internals, be ready to merge ;) |
70aaed7 to
335c0fc
Compare
|
PR rebased with minor conflicts resolved. Anybody to push the merge button? |
|
Thanks for the reminder. I will handle this today. |
After __isset() returns true under ?? or empty(), re-check the property table before calling __get(). When __isset() materialised the property (a pattern used by lazy proxies), its value is returned directly. isset() itself is unchanged. Closes phpGH-12695.
335c0fc to
762ec32
Compare
|
Thanks Nicolas! |
Fixes #12695.
After
__isset()returns true under??orempty(), the engine re-checks the property table before calling__get(). When__isset()has materialised the property (a pattern used by lazy proxies), its value is returned directly and__get()is skipped.isset()is unchanged (it never called__get()).Tests under
Zend/tests/magic_methods/gh12695*.phptcover:??andempty()__isset()doesn't materialise,__get()is still called and??'s null-check still appliesisset()'s unchanged behaviour