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.
 
 

28 lines
394 B

--TEST--
generator automatic integer keys track the greatest integer key
--FILE--
<?php
function mixed_keys(): iterable
{
yield 'name' => 1;
yield 2;
yield 5 => 3;
yield 4;
yield -2 => 5;
yield 6;
}
function main(): void
{
foreach (mixed_keys() as $key => $value) {
var_dump($key);
}
}
?>
--EXPECT--
string(4) "name"
int(0)
int(5)
int(6)
int(-2)
int(7)