TypePHP 编译器 https://swoole.com/aot/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

24 lines
437 B

--TEST--
foreach iterator destructuring supports nested and keyed items
--FILE--
<?php
function main(): void
{
$rows = new ArrayObject([
['id' => 10, 'pair' => ['x', 'y']],
['id' => 20, 'pair' => ['m', 'n']],
]);
foreach ($rows as ['id' => $id, 'pair' => [$left, $right]]) {
var_dump($id, $left, $right);
}
}
?>
--EXPECT--
int(10)
string(1) "x"
string(1) "y"
int(20)
string(1) "m"
string(1) "n"