#43140 [Opn->Bgs]: Error in parser
| From: | johannes@php.net | Date: | Tue, 30 Oct 2007 16:48:33 +0000 |
| Subject: | #43140 [Opn->Bgs]: Error in parser | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-119085@lists.php.net to get a copy of this message | ||
ID: 43140
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
create_fucntion($params, $code) actually is eval("function
lambda1($params) { $code }"). In your code $params is an Array which is
being casted to a string "Array" so the full code reads like
function lambda(Array) { print1; }
where the error message is misleading but correct.
Previous Comments:
------------------------------------------------------------------------
[2007-10-30 12:09:05] felipensp at gmail dot com
Description:
------------
Parser recognize wrong the array parameter.
It see array(..) as (array).
Reproduce code:
---------------
$a = create_function(array(1), 'print 1;');
Expected result:
----------------
Parse error: syntax error, unexpected T_ARRAY, expecting '&' or
T_VARIABLE
Actual result:
--------------
Parse error: syntax error, unexpected T_ARRAY_CAST, expecting '(' in
/home/felipe/public_html/bug.php(4) : runtime-created function
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=43140&edit=1