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

From: Date: Wed, 01 Dec 2010 14:26:36 +0000
Subject: Req #53408 [Opn->Bgs]: Calling a function returned from a function in one line
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-156625@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: jani@php.net Reported by: softwareelves+php at gmail dot com Summary: Calling a function returned from a function in one line -Status: Open +Status: Bogus Type: Feature/Change Request Package: Scripting Engine problem Operating System: Any PHP Version: 5.3.3 Block user comment: N Private report: N New Comment: And there are other requests for this already. Try search before spamming the bug database. Previous Comments: ------------------------------------------------------------------------ [2010-11-30 19:50:09] felipe@php.net There is a RFC for such. http://wiki.php.net/rfc/fcallfcall ------------------------------------------------------------------------ [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 (#156625) next »