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.
20 lines
568 B
20 lines
568 B
--TEST--
|
|
Symfony pattern: foreach array destructuring with keyed rows
|
|
--FILE--
|
|
<?php
|
|
|
|
function main(): void
|
|
{
|
|
$openHandles = [
|
|
'a' => [1, 'handle-a', 'buffer-a', static fn () => 'progress-a'],
|
|
'b' => [2, 'handle-b', 'buffer-b', static fn () => 'progress-b'],
|
|
];
|
|
|
|
foreach ($openHandles as $id => [$pauseExpiry, $handle, $buffer, $onProgress]) {
|
|
var_dump($id.':'.$pauseExpiry.':'.$handle.':'.$buffer.':'.$onProgress());
|
|
}
|
|
}
|
|
?>
|
|
--EXPECT--
|
|
string(32) "a:1:handle-a:buffer-a:progress-a"
|
|
string(32) "b:2:handle-b:buffer-b:progress-b"
|
|
|