php-src/Zend/tests/array_unpack/ref1.phpt
2020-08-09 22:03:36 +02:00

18 lines
276 B
PHP

--TEST--
Array unpacking with element rc=1
--FILE--
<?php
$a = 1;
$b = [&$a]; //array (0 => (refcount=2, is_ref=1)=1)
unset($a); //array (0 => (refcount=1, is_ref=1)=1)
var_dump([...$b]); //array (0 => (refcount=0, is_ref=0)=1)
?>
--EXPECT--
array(1) {
[0]=>
int(1)
}