#51104 [Opn->Csd]: Fatal error when using Lambda function & error_reporting() in same file

From: Date: Sun, 21 Feb 2010 08:02:51 +0000
Subject: #51104 [Opn->Csd]: Fatal error when using Lambda function & error_reporting() in same file
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-147916@lists.php.net to get a copy of this message
ID: 51104 User updated by: gern_ at hotmail dot com Reported By: gern_ at hotmail dot com -Status: Open +Status: Closed Bug Type: Scripting Engine problem Operating System: Windows 7 Pro 64bit PHP Version: 5.3.1 New Comment: I did a fresh install of PHP 5.3.1 and no more Fatal Error Previous Comments: ------------------------------------------------------------------------ [2010-02-21 07:42:52] mick1986 at hotmail dot com I'm having similar issue on the same OS & PHP version. $lambda = function() { print 'Hello World'; }; $lambda(); $array['test'] = 2; // this trigger a Fatal Error ------------------------------------------------------------------------ [2010-02-21 07:23:35] gern_ at hotmail dot com Description: ------------ When calling error_reporting() before any lambda function will cause a Fatal Error. Putting error_reporting() in a separate file "fix" this bug. Reproduce code: --------------- error_reporting(E_ALL); // uncomment this line to work $lambda = function() { print 'Hello World'; }; $lambda(); // calling error_reporting(E_ALL) at this point will not cause Fatal Error Expected result: ---------------- Hello World Actual result: -------------- Fatal error: Function name must be a string in D:\www\lambda.php on line 6 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=51104&edit=1

« previous php.bugs (#147916) next »