#43142 [Opn->Bgs]: Call different function
| From: | johannes@php.net | Date: | Tue, 30 Oct 2007 16:51:32 +0000 |
| Subject: | #43142 [Opn->Bgs]: Call different function | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-119086@lists.php.net to get a copy of this message | ||
ID: 43142
Updated by: johannes@php.net
Reported By: felipensp at gmail dot com
-Status: Open
+Status: Bogus
Bug Type: Scripting Engine problem
Operating System: Linux
PHP Version: 5.3CVS-2007-10-30 (snap)
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
Mind the 12 as length of oyur output - the actual name of the lambda
function is "\0lambda_1" but your terminal/browser doesn't dispaly the
null byte.
Previous Comments:
------------------------------------------------------------------------
[2007-10-30 13:07:53] felipensp at gmail dot com
Description:
------------
Return of create_function() concat. with 'foo'.
But, when calling the function with the name of variable's value, only
'foo' is used...
Reproduce code:
---------------
<?php
$a = 'foo'. create_function('', 'print "foo!";');
var_dump($a); // string(12) "foolambda_1"
function foo() { print 1; }
$a(); // Fatal error: Call to undefined function foo()
// foo() ?!
Expected result:
----------------
Fatal error: Call to undefined function foolambda_1()
Actual result:
--------------
string(12) "foolambda_1"
Fatal error: Call to undefined function foo()
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=43142&edit=1