From: matt dot minix at gmail dot com Operating system: Linux PHP version: 5.4.18 Package: Variables related Bug Type: Bug Bug description:Anonymous functions not callable directly when part of a static class
Description: ------------ An anonymous function doesn't seem like it can be called directly when in a static class. Test script: --------------- class a { public static $b; } a::$b = static function($c) { echo $c; }; a::$b('Test'); I am however able to do class a { public static $b; } a::$b = static function($c) { echo $c; }; $Temp = a::$b; $Temp('Test'); Expected result: ---------------- "Test" Actual result: -------------- Fatal error: Function name must be a string -- Edit bug report at https://bugs.php.net/bug.php?id=65530&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=65530&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=65530&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=65530&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=65530&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=65530&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=65530&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=65530&r=needscript Try newer version: https://bugs.php.net/fix.php?id=65530&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=65530&r=support Expected behavior: https://bugs.php.net/fix.php?id=65530&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=65530&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=65530&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=65530&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=65530&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=65530&r=dst IIS Stability: https://bugs.php.net/fix.php?id=65530&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=65530&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=65530&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=65530&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=65530&r=mysqlcfg