Skip to content

ext/standard: serialize() context reused by destructors during teardown. - #24452

Closed
devnexen wants to merge 3 commits into
php:PHP-8.4from
devnexen:gh24373
Closed

devnexen wants to merge 3 commits into
php:PHP-8.4from
devnexen:gh24373

Conversation

@devnexen

Copy link
Copy Markdown
Member

Fix #24373

The context was destroyed while still registered. Unregister it first.

Fix php#24373

The context was destroyed while still registered. Unregister it first.
@devnexen
devnexen marked this pull request as ready for review October 20, 2026 07:05
@devnexen
devnexen requested a review from bukka as a code owner October 20, 2026 07:05
@iliaal
iliaal self-requested a review October 22, 2026 15:21

@iliaal iliaal left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, maybe add a test for the unserialize side too? Something like this:

class D { 
   function __destruct() { 
      $GLOBALS['r'] = unserialize('a:2:{i:0;O:8:"stdClass":0:{}i:1;r:2;}');
   } 
}
unserialize('a:2:{i:0;O:1:"D":0:{}i:0;i:1;}');
var_dump($GLOBALS['r'][0] === $GLOBALS['r'][1]);

@devnexen devnexen closed this in 08f4b64 Oct 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants