From:             vincent at consultmac dot com
Operating system: Apache
PHP version:      4CVS-2003-07-18 (stable)
PHP Bug Type:     Feature/Change Request
Bug description:  eval '}' bug 

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 bug report at http://bugs.php.net/?id=24712&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=24712&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=24712&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=24712&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=24712&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=24712&r=needtrace
Try newer version:          http://bugs.php.net/fix.php?id=24712&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=24712&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=24712&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=24712&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=24712&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=24712&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=24712&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=24712&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=24712&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=24712&r=gnused

Reply via email to