mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
All other code caters to dereferencing array elements, except the unserialize handler. This causes references to be present in the fixed array even though this seems not intentional as reference assign is otherwise impossible. On 8.5+ this causes an assertion failure. On 8.3+ this causes references to be present where they shouldn't be. Closes GH-20616.
24 lines
338 B
PHP
24 lines
338 B
PHP
--TEST--
|
|
GH-20614 (SplFixedArray incorrectly handles references in deserialization)
|
|
--FILE--
|
|
<?php
|
|
|
|
$fa = new SplFixedArray(0);
|
|
$nr = 1;
|
|
$array = [&$nr];
|
|
$fa->__unserialize($array);
|
|
var_dump($fa);
|
|
unset($fa[0]);
|
|
var_dump($fa);
|
|
|
|
?>
|
|
--EXPECT--
|
|
object(SplFixedArray)#1 (1) {
|
|
[0]=>
|
|
int(1)
|
|
}
|
|
object(SplFixedArray)#1 (1) {
|
|
[0]=>
|
|
NULL
|
|
}
|