|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2013-09-05 21:15 UTC] aharvey@php.net
-Package: Compile Failure
+Package: Scripting Engine problem
[2013-09-05 21:15 UTC] aharvey@php.net
[2014-03-06 08:56 UTC] tri at iki dot fi
[2015-03-21 20:42 UTC] nikic@php.net
-Status: Open
+Status: Closed
-Assigned To:
+Assigned To: nikic
[2015-03-21 20:42 UTC] nikic@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 04:00:01 2025 UTC |
Description: ------------ Calling the return value from a function as a function directly (without storing the return value in an intermediate variable) results in a parse error. Apparently, the PHP parser does not understand `foo()()` or `(foo())()`. Test script: --------------- <?php function foo($a) { return function ($b) use ($a) { print "$a, $b!\n"; }; } foo("Hello")("world"); Expected result: ---------------- Program prints "Hello, world!" Actual result: -------------- PHP Parse error: syntax error, unexpected '(' in /home/tobias/test/test.php on line 9