-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Fix nullsafe operator on delayed oplines #5994
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
Conversation
7a4e7d5
to
491caf6
Compare
This fixes https://bugs.php.net/79995. |
@nikic I'd appreciate a review. I'm not sure if there's a better solution that doesn't require tracking the delayed offsets. |
37b0c2f
to
2460728
Compare
I just realized tracking the entire stack was absolutely unnecessary. We're now only storing the last offset. Hopefully this is fine now. |
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 think the last offset is sufficient. Consider something like this:
<?php
$foo = (object) ['bar' => 0];
$array = [[null]];
var_dump($array[0][$foo->bar]?->baz);
You don't want the offset from the $foo->bar
.
😕 You're right. I'll take another look after work. |
2460728
to
473beb0
Compare
That was way harder than it should've been. It works now, let me clean it up tomorrow. |
473beb0
to
369c2ea
Compare
Sorry for not getting back to this sooner. Can you give this another review? Can you think of a simpler way to solve this? Also, maybe we should rename all the |
I've opened #6056 with another approach that seems more straightforward to me. What do you think about it? |
Closing in favor of #6056. |
No description provided.