From: Operating system: Linux, Fedora 13 64 bits PHP version: 5.3.2 Package: Scripting Engine problem Bug Type: Bug Bug description:Closure problem with 5.3.2
Description: ------------ NULL when using Closures with "use" keyword in PHP 5.3.2 Test script: --------------- <?php $test = 'Closure test'; $closure = function() use ( $test ) { return $test; }; var_dump( phpversion() , $closure ); Expected result: ---------------- PHP 5.3.0 output: string(5) "5.3.0" object(Closure)#1 (1) { ["static"]=> array(1) { ["test"]=> string(12) "Closure test" } } Actual result: -------------- PHP 5.3.2 output: string(5) "5.3.2" NULL -- Edit bug report at http://bugs.php.net/bug.php?id=52039&edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=52039&r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=52039&r=trysnapshot53 Try a snapshot (trunk): http://bugs.php.net/fix.php?id=52039&r=trysnapshottrunk Fixed in SVN: http://bugs.php.net/fix.php?id=52039&r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=52039&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=52039&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=52039&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=52039&r=needscript Try newer version: http://bugs.php.net/fix.php?id=52039&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=52039&r=support Expected behavior: http://bugs.php.net/fix.php?id=52039&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=52039&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=52039&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=52039&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=52039&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=52039&r=dst IIS Stability: http://bugs.php.net/fix.php?id=52039&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=52039&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=52039&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=52039&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=52039&r=mysqlcfg