Edit report at http://bugs.php.net/bug.php?id=52039&edit=1

 ID:               52039
 Updated by:       degeb...@php.net
 Reported by:      neto dot joaobatista at gmail dot com
 Summary:          Closure problem with 5.3.2
-Status:           Open
+Status:           Feedback
 Type:             Bug
 Package:          Scripting Engine problem
 Operating System: Linux, Fedora 13 64 bits
 PHP Version:      5.3.2

 New Comment:

Please try using this snapshot:

  http://snaps.php.net/php5.3-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/

I get the following output:



string(9) "5.3.3-dev"

object(Closure)#1 (1) {

  ["static"]=>

  array(1) {

    ["test"]=>

    string(12) "Closure test"

  }

}


Previous Comments:
------------------------------------------------------------------------
[2010-06-10 13:53:26] neto dot joaobatista at gmail dot com

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 this bug report at http://bugs.php.net/bug.php?id=52039&edit=1

Reply via email to