Req #53408 [Opn]: Calling a function returned from a function in one line

From: Date: Tue, 30 Nov 2010 18:50:09 +0000
Subject: Req #53408 [Opn]: Calling a function returned from a function in one line
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-156597@lists.php.net to get a copy of this message
Edit report at http://bugs.php.net/bug.php?id=53408&edit=1 ID: 53408 Updated by: felipe@php.net Reported by: softwareelves+php at gmail dot com Summary: Calling a function returned from a function in one line Status: Open Type: Feature/Change Request Package: Unknown/Other Function Operating System: Any PHP Version: 5.3.3 Block user comment: N Private report: N New Comment: There is a RFC for such. http://wiki.php.net/rfc/fcallfcall Previous Comments: ------------------------------------------------------------------------ [2010-11-25 21:23:09] softwareelves+php at gmail dot com Description: ------------ Since we can now pass around function much easier, It would be beneficial to be able to "chain" together function calls. Test script: --------------- <?php function returnClosure() { return function() { print "helloworld"; }; } returnClosure()(); Expected result: ---------------- helloworld Actual result: -------------- Parse error: syntax error, unexpected '(' in test.php on line 9 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/bug.php?id=53408&edit=1

« previous php.bugs (#156597) next »