xref: /PHP-7.4/Zend/tests/array_unpack/ref1.phpt (revision 63e43e19)
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--EXPECT--
14array(1) {
15  [0]=>
16  int(1)
17}
18