xref: /PHP-8.0/Zend/tests/array_unpack/ref1.phpt (revision 7aacc705)
1--TEST--
2Array unpacking with element rc=1
3--FILE--
4<?php
5
6$a = 1;
7$b = [&$a]; //array (0 => (refcount=2, is_ref=1)=1)
8
9unset($a); //array (0 => (refcount=1, is_ref=1)=1)
10
11var_dump([...$b]); //array (0 => (refcount=0, is_ref=0)=1)
12
13?>
14--EXPECT--
15array(1) {
16  [0]=>
17  int(1)
18}
19