1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 16:22:37 +01:00
Files
archived-php-src/ext/spl/tests/fixedarray_023.phpt
Tyson Andre cd1c6f0b81 Fixes infinite recursion introduced by patch to SplFixedArray (#8105)
Closes GH-8079

Track whether the spl_fixedarray was modified since the last call to
get_properties
2022-02-23 19:23:00 -05:00

36 lines
749 B
PHP

--TEST--
SPL: FixedArray: Infinite loop in var_export bugfix
--FILE--
<?php
call_user_func(function () {
$x = new SplFixedArray(4);
$x[0] = NAN; // Test NAN just in case this check is incorrectly refactored to use zend_is_identical
$x[1] = 0.0;
$x[2] = $x;
$x[3] = $x;
var_export($x);
echo "\n";
$x[1] = -0.0;
debug_zval_dump($x);
});
?>
--EXPECTF--
Warning: var_export does not handle circular references in %s on line 8
Warning: var_export does not handle circular references in %s on line 8
SplFixedArray::__set_state(array(
0 => NAN,
1 => 0.0,
2 => NULL,
3 => NULL,
))
object(SplFixedArray)#2 (4) refcount(6){
[0]=>
float(NAN)
[1]=>
float(-0)
[2]=>
*RECURSION*
[3]=>
*RECURSION*
}