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

From: Date: Sat, 26 Jul 2008 13:52:52 +0000
Subject: #45608 [Opn->Asn]: closures don't work in static methods
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-127280@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: Open +Status: Assigned Bug Type: Scripting Engine problem Operating System: * PHP Version: 5.3CVS-2008-07-23 (CVS) -Assigned To: +Assigned To: dmitry 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 (#127280) next »