#45608 [NEW]: closures don't work in static methods
| From: | php at benjaminschulz dot com | Date: | Wed, 23 Jul 2008 18:18:13 +0000 |
| Subject: | #45608 [NEW]: closures don't work in static methods | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-127207@lists.php.net to get a copy of this message | ||
From: php at benjaminschulz dot com
Operating system:
PHP version: 5.3CVS-2008-07-23 (CVS)
PHP Bug Type: Scripting Engine problem
Bug description: closures don't work in static methods
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 bug report at http://bugs.php.net/?id=45608&edit=1
--
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=45608&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=45608&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=45608&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=45608&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=45608&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=45608&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=45608&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=45608&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=45608&r=support
Expected behavior: http://bugs.php.net/fix.php?id=45608&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=45608&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=45608&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=45608&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=45608&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=45608&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=45608&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=45608&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=45608&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=45608&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=45608&r=mysqlcfg