ID:               24712
 Updated by:       [EMAIL PROTECTED]
 Reported By:      vincent at consultmac dot com
-Status:           Open
+Status:           Bogus
 Bug Type:         Feature/Change Request
 Operating System: Apache
 PHP Version:      4CVS-2003-07-18 (stable)
 New Comment:

You're just doing something wrong here, try to prove me wrong by
submitting a FULL script that we can copy and paste to try ourselves.


Previous Comments:
------------------------------------------------------------------------

[2003-07-18 18:57:06] vincent at consultmac dot com

Description:
------------
When I try to create a new function using eval(), it 
just return a parse error: "unexpected '}'"


Oh, I'm using version 4.2.2

Reproduce code:
---------------
function new_func($args,$code) {
$ldelim = '{';
$rdelim = '}'
$l = 'abcdefghijklmnopqrstuvwxyz';
$ret = '';
for ($x = 0; $x < 15; $x++):
$ret .= $l[rand(0,strlen($l) - 1)];
endfor;

eval('function ' . $ret . '(' . $args . ')' . $ldelim . " " . $code . "
" .  $rdelim);

return $ret;

}

Expected result:
----------------
To "eval a new function.

Actual result:
--------------
Reports "unexpected '}' on line..."


------------------------------------------------------------------------


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

Reply via email to