jphp-group / jphp

JPHP - an implementation of PHP on Java VM

Home Page:http://jphp.develnext.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Broken array expansion in foreach

danog opened this issue · comments

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