Repository navigation
Conversation
…troying old one in hash update Signed-off-by: Roman Ondráček <mail@romanondracek.cz>
Roman3349
requested review from
Girgias,
bukka,
dstogov and
jorgsowa
as code owners
November 26, 2026 21:26
Roman3349
force-pushed
the
fix/gh-25700-hash-update-order
branch
from
November 26, 2026 21:29
9639157 to
04c9179
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When an existing value is replaced, _zend_hash_add_or_update_i() and its str and index variants destroy the old value before storing the new one, so a destructor running from it still finds the old value in the table. Store the new value first and destroy the old one afterwards, as zend_hash_del() already does. zend_hash_str_del_ind() now uses the same order as zend_hash_del_ind().
The auto-global callbacks also added the PG(http_globals) reference only after zend_hash_update(), so a destructor that unset or replaced $_ENV or $_SERVER freed the new array. Add the reference first.
Fixes GH-25700
Fixes GH-25706