Bug #74726 [NEW]: Cannot call closure from static class member
| From: | matteo_tassinari_TM at libero dot it | Date: | Fri, 09 Jun 2017 08:56:22 +0000 |
| Subject: | Bug #74726 [NEW]: Cannot call closure from static class member | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-209442@lists.php.net to get a copy of this message | ||
From: matteo_tassinari_TM at libero dot it
Operating system: Linux
PHP version: 7.0.20
Package: Scripting Engine problem
Bug Type: Bug
Bug description:Cannot call closure from static class member
Description:
------------
If you declare a closure as a static member of a class, you cannot call
it directly.
Test script:
---------------
class T {
public static $f;
}
T::$f = function() { echo "static member\n"; };
$f = function() { echo "local variable\n"; };
$f();
T::$f();
Expected result:
----------------
local variable
static member
Actual result:
--------------
local variable
Fatal error: Uncaught Error: Function name must be a string
--
Edit bug report at https://bugs.php.net/bug.php?id=74726&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=74726&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=74726&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=74726&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=74726&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=74726&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=74726&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=74726&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=74726&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=74726&r=support
Expected behavior: https://bugs.php.net/fix.php?id=74726&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=74726&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=74726&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=74726&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=74726&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=74726&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=74726&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=74726&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=74726&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=74726&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=74726&r=mysqlcfg