php-src/Zend/tests/bug35163_2.phpt
Nikita Popov ae6f45ad45 var_dump(): Don't skip recursion detection on first level
This is confusing. The current output doesn't make it clear that
we're in fact recursing to the top-level structure.

Closes GH-5171.
2020-02-12 11:25:50 +01:00

23 lines
272 B
PHP

--TEST--
Bug #35163.2 (Array elements can lose references)
--FILE--
<?php
$a = array(1);
$b = 'a';
${$b}[] =& $$b;
${$b}[] =& $$b;
${$b}[0] = 2;
var_dump($a);
$a[0] = null;
$a = null;
?>
--EXPECT--
array(3) {
[0]=>
int(2)
[1]=>
*RECURSION*
[2]=>
*RECURSION*
}