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

 ID:                 52039
 Updated by:         fel...@php.net
 Reported by:        neto dot joaobatista at gmail dot com
 Summary:            Closure problem with 5.3.2
-Status:             Feedback
+Status:             Closed
 Type:               Bug
 Package:            Scripting Engine problem
 Operating System:   Linux, Fedora 13 64 bits
 PHP Version:        5.3.2
-Assigned To:        
+Assigned To:        felipe
 Block user comment: N

 New Comment:

Surely it will show the same result on Apache... Closed.


Previous Comments:
------------------------------------------------------------------------
[2010-06-10 17:18:01] neto dot joaobatista at gmail dot com

New information,



PHP: 5.3.0, 5.3.2 and 5.3.3 works fine as CLI



Output from 5.3.3



string(9) "5.3.3-dev"

object(Closure)#1 (1) {

  ["static"]=>

  array(1) {

    ["test"]=>

    string(12) "Closure test"

  }

}



Using PHP 5.3.3-dev as CGI works too:



string(9) "5.3.3-dev"

object(Closure)#1 (1) {

  ["static"]=>

  array(1) {

    ["test"]=>

    string(12) "Closure test"

  }

}



I just couldn't test 5.3.3-dev as Apache module yet, but 5.3.2 doesn't
work as module, giving me:



string(5) "5.3.2"

NULL



Server Version: Apache/2.2.15 (Unix) DAV/2 PHP/5.3.2 mod_python/3.3.1
Python/2.6.4 mod_ssl/2.2.15 OpenSSL/1.0.0-fips mod_perl/2.0.4
Perl/v5.10.1

------------------------------------------------------------------------
[2010-06-10 14:09:48] degeb...@php.net

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"

  }

}

------------------------------------------------------------------------
[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