Broken array expansion in foreach
danog opened this issue · comments
Daniil Gentili commented
Code:
<?php
foreach ([['a', 'b']] as $index => [$name, $value]) {
var_dump($index, $name, $value);
}
Result:
[daniil@daniil-arch jav]$ php src/s.php
int(0)
string(1) "a"
string(1) "b"
[daniil@daniil-arch jav]$ jppm start
-> linux
-> app:run
-> install
Fatal error: Uncaught ParseError: Syntax error, unexpected '[' in res://s.php on line 3, position 17
Stack Trace:
#0 {main}
thrown in res://s.php on line 3