|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-07-19 03:28 UTC] derick@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Dec 05 18:00:01 2025 UTC |
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..."