#46056 [Opn->Bgs]: Function returned by function

From: Date: Thu, 11 Sep 2008 16:08:32 +0000
Subject: #46056 [Opn->Bgs]: Function returned by function
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-128890@lists.php.net to get a copy of this message
ID: 46056 Updated by: felipe@php.net Reported By: odakynn at gmail dot com -Status: Open +Status: Bogus Bug Type: Scripting Engine problem Operating System: Windows XP PHP Version: 5.3.0alpha2 New Comment: That is expected, func()() cannot be used. Previous Comments: ------------------------------------------------------------------------ [2008-09-11 15:57:54] odakynn at gmail dot com Description: ------------ I was trying to call a function returned by another function and it caused a parse error. Reproduce code: --------------- function a() { echo 'a'; return create_function('', 'echo \'b\';'); }; a()(); - OR - function a() { echo 'a'; return function() { echo 'b'; }; }; a()(); Expected result: ---------------- ab Actual result: -------------- Parse error: syntax error, unexpected '(' in ... ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=46056&edit=1

« previous php.bugs (#128890) next »