mirror of
https://github.com/php/php-src.git
synced 2026-03-24 08:12:21 +01:00
Support list() reference assignments of the form:
list(&$a, list(&$b, $c)) = $d;
RFC: https://wiki.php.net/rfc/list_reference_assignment
21 lines
272 B
PHP
21 lines
272 B
PHP
--TEST--
|
|
"Reference Unpacking - New Reference" list()
|
|
--FILE--
|
|
<?php
|
|
$arr = array(new stdclass);
|
|
list(&$a, &$b) = $arr;
|
|
var_dump($a, $b);
|
|
var_dump($arr);
|
|
?>
|
|
--EXPECTF--
|
|
object(stdClass)#%d (0) {
|
|
}
|
|
NULL
|
|
array(2) {
|
|
[0]=>
|
|
&object(stdClass)#%d (0) {
|
|
}
|
|
[1]=>
|
|
&NULL
|
|
}
|