php-src/ext/standard/tests/serialize/SplObjectStorage_object_reference.phpt
Nikita Popov 11648c00e9 Don't include object hash in SplObjectStorage debug dump
The object hash is not particularly useful (anymore) and just
clutters the output. It encodes the same information as the
object ID, which is already part of the output.
2021-05-18 17:20:20 +02:00

33 lines
574 B
PHP

--TEST--
Reference to SplObjectStorage key (not supported)
--FILE--
<?php
$inner = 'x:i:1;O:8:"stdClass":0:{};m:a:0:{}';
$inner_len = strlen($inner);
$str = <<<STR
a:2:{i:0;C:16:"SPlObjectStorage":{$inner_len}:{{$inner}}i:1;R:4;}
STR;
var_dump(unserialize($str));
?>
--EXPECT--
array(2) {
[0]=>
object(SplObjectStorage)#1 (1) {
["storage":"SplObjectStorage":private]=>
array(1) {
[0]=>
array(2) {
["obj"]=>
object(stdClass)#2 (0) {
}
["inf"]=>
NULL
}
}
}
[1]=>
object(stdClass)#2 (0) {
}
}