mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
18 lines
276 B
PHP
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)
|
|
}
|