We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The following code:
<?php $stor = new SplObjectStorage(); $obj = new stdClass; $stor[$obj] = 1; $tmp = $stor->__debugInfo(); $tmp2 = $tmp[array_key_first($tmp)]; unset($tmp); // Drop $tmp2 RC to 1 $tmp2[0]['obj'] = new stdClass; var_dump($tmp2);
Resulted in this output:
A bunch of ASAN crap
But I expected this output instead:
Not that
The problem is that the code uses a hack rather than properly managing memory: Z_ARRVAL_P(&tmp)->pDestructor = NULL;...
Z_ARRVAL_P(&tmp)->pDestructor = NULL;
8.3+
No response
The text was updated successfully, but these errors were encountered:
Fix phpGH-18322: SplObjectStorage debug handler mismanages memory
1424fdc
This hack was once necessary before there was a proper get_gc handler, but now it breaks the engine constraints.
Merge branch 'PHP-8.3' into PHP-8.4
fc63a98
* PHP-8.3: Fix GH-18322: SplObjectStorage debug handler mismanages memory
6750387
Merge branch 'PHP-8.4'
89e5f6c
* PHP-8.4: Fix GH-18322: SplObjectStorage debug handler mismanages memory
nielsdos
Successfully merging a pull request may close this issue.
Description
The following code:
Resulted in this output:
But I expected this output instead:
The problem is that the code uses a hack rather than properly managing memory:
Z_ARRVAL_P(&tmp)->pDestructor = NULL;
...PHP Version
8.3+
Operating System
No response
The text was updated successfully, but these errors were encountered: