From: nospam at example dot com Operating system: Windows XP SP3 PHP version: 5.3.0beta1 PHP Bug Type: Compile Failure Bug description: static lambda function now give parse error
Description: ------------ The latest 5.3.0beta1 has broken static lambda functions. Previously this worked on 5.3.0alpha3. The example below is taken from: http://wiki.php.net/rfc/closures The rfc page recommends using static to reduce memory overhead. Reproduce code: --------------- class Example { public function doSomething () { $x = 4; $closure = static function ($y) use ($x) { return $x + $y; }; return $closure (6); } } Expected result: ---------------- Parse error: parse error, expecting `T_PAAMAYIM_NEKUDOTAYIM' -- Edit bug report at http://bugs.php.net/?id=47299&edit=1 -- Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=47299&r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=47299&r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=47299&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=47299&r=fixedcvs Fixed in CVS and need be documented: http://bugs.php.net/fix.php?id=47299&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=47299&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=47299&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=47299&r=needscript Try newer version: http://bugs.php.net/fix.php?id=47299&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=47299&r=support Expected behavior: http://bugs.php.net/fix.php?id=47299&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=47299&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=47299&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=47299&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=47299&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=47299&r=dst IIS Stability: http://bugs.php.net/fix.php?id=47299&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=47299&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=47299&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=47299&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=47299&r=mysqlcfg