Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Array brackets after function calls are fixed in PHP 5.4:

~/php_source/php-src-5.3$ ./sapi/cli/php -r "function a() { return array(1,2); } print a()[0];"

Parse error: syntax error, unexpected '[' in Command line code on line 1

~/php_source/php-src-5.4$ ./sapi/cli/php -r "function a() { return array(1,2); } print a()[0];"

1



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: