mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
This hack was once necessary before there was a proper get_gc handler, but now it breaks the engine constraints. Closes GH-18323.
28 lines
433 B
PHP
28 lines
433 B
PHP
--TEST--
|
|
GH-18322 (SplObjectStorage debug handler mismanages memory)
|
|
--FILE--
|
|
<?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);
|
|
|
|
?>
|
|
--EXPECT--
|
|
array(1) {
|
|
[0]=>
|
|
array(2) {
|
|
["obj"]=>
|
|
object(stdClass)#3 (0) {
|
|
}
|
|
["inf"]=>
|
|
int(1)
|
|
}
|
|
}
|