#45608 [Asn->Csd]: closures don't work in static methods

From: Date: Sat, 26 Jul 2008 14:16:12 +0000
Subject: #45608 [Asn->Csd]: closures don't work in static methods
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-127282@lists.php.net to get a copy of this message
ID: 45608 Updated by: dmitry@php.net Reported By: php at benjaminschulz dot com -Status: Assigned +Status: Closed Bug Type: Scripting Engine problem Operating System: * PHP Version: 5.3CVS-2008-07-23 (CVS) Assigned To: dmitry New Comment: This bug has been fixed in CVS. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. Thank you for the report, and for helping us make PHP better. Previous Comments: ------------------------------------------------------------------------ [2008-07-23 18:18:13] php at benjaminschulz dot com Description: ------------ If a closure is declared in a statically called method it cannot be executed. Reproduce code: --------------- --TEST-- Closure 023: Closure declared in statically called method --FILE-- <?php class foo { public static function bar() { $func = function() { echo "Done"; }; $func(); } } foo::bar(); ?> --EXPECTF-- Done Actual result: -------------- Non-static method foo::() cannot be called statically in ... ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=45608&edit=1

« previous php.bugs (#127282) next »