|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2014-10-07 14:20 UTC] nikic@php.net
-Status: Open
+Status: Closed
-Assigned To:
+Assigned To: nikic
[2014-10-07 14:20 UTC] nikic@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Dec 26 09:00:02 2025 UTC |
Description: ------------ PHP 5.4 allows us to make a call after array dereference: $a = [function () { return 42; }]; var_dump( $a[0]() ); // int(42) PHP 5.5 allows us to dereferende literal array even: var_dump([42][0]); // int(42) But combination of this features cause a syntax error. Test in a sandbox: http://3v4l.org/1CHXs Test script: --------------- var_dump([function () { return 42; }][0]()); Expected result: ---------------- int(42) Actual result: -------------- Parse error: syntax error, unexpected '(' in ...