Bug #66983 [Opn->Fbk]: anonymous function

From: Date: Tue, 10 Mar 2015 21:11:18 +0000
Subject: Bug #66983 [Opn->Fbk]: anonymous function
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-191296@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=66983&edit=1 ID: 66983 Updated by: nikic@php.net Reported by: koushky at gmail dot com Summary: anonymous function -Status: Open +Status: Feedback Type: Bug Package: Variables related Operating System: linux x86_64 PHP Version: 5.4.26 Block user comment: N Private report: N New Comment: I can't reproduce this behavior on any PHP version: http://3v4l.org/rXeKq Valgrind didn't produce any output either. Previous Comments: ------------------------------------------------------------------------ [2014-03-30 18:11:30] koushky at gmail dot com Description: ------------ i use anonymous function in other function when there is array union operator (+) above of this anonymous then the variable convert to NULL . Test script: --------------- class foo { public function test($o = array()){ $o += array('test'); $func = function(){}; var_dump($func); } } $foo = new foo; $foo->test(); Expected result: ---------------- object(Closure)#2 (1) { ["this"]=> object(x)#1 (0) { } } Actual result: -------------- NULL ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=66983&edit=1

« previous php.bugs (#191296) next »