-
Notifications
You must be signed in to change notification settings - Fork 7.8k
Fix substr_replace with slots in repl_ht being UNDEF #10323
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
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 can do a follow-up if you want. The only "issue" then I guess is that the PHP-8.1 branch will not be a subset of PHP-8.2+ ? |
@nielsdos We must merge upstream, so whoever merges this will need to resolve the merge conflict, and thus just adjusting the other line should be ok. Would be nice if we had a test for the unpacked case too, we could probably create an unpacked array like this: $array = ['foo', 42 => 'bar', 'baz'];
unset($array[42]); But I haven't tested it. |
Whoops... of course, that makes sense 😅
I'll check tomorrow if this test would work with some good old printf debugging, and add it if that is the case :) |
The check that was supposed to check whether the array slot was UNDEF was wrong and never triggered. This resulted in a replacement with the empty string or the wrong string instead of the correct one. The correct check pattern can be observed higher up in the function's code.
6c72034
to
a5de492
Compare
Yep your test works, thanks. I updated the test file to include your test. |
@nielsdos Perfect, thank you! |
The check that was supposed to check whether the array slot was UNDEF was wrong and never triggered. This resulted in a replacement with the empty string or the wrong string instead of the correct one. The correct check pattern can be observed higher up in the function's code.
EDIT: Appveyor failure due to
Bug #48182: ssl handshake fails during asynchronous socket connection [C:\projects\php-src\ext\openssl\tests\bug48182.phpt]
, which is unrelated