php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #9417 zend_eval_string() doesn't work like eval() :(
Submitted: 2001-02-22 21:13 UTC Modified: 2013-07-30 03:37 UTC
Votes:3
Avg. Score:4.7 ± 0.5
Reproduced:1 of 2 (50.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: david at guerizec dot net Assigned: yohgaki (profile)
Status: Closed Package: Scripting Engine problem
PHP Version: 4.0 Latest CVS (22/02/2001) OS: GNU/linux
Private report: No CVE-ID: None
 [2001-02-22 21:13 UTC] david at guerizec dot net
I need to simulate a call to eval() and the only function
that seems to be able to do it is zend_eval_string().
Although it evaluates the string when I put NULL as second
parameter (retval_ptr), it doesn't work (parse error) when I
want to simulate the new behavior of PHP4 eval() (ie. with a
return value)

Is it possible to change the existing zend_eval_string (I
think not cause pcre and assert use it this way already) ?

If not, is it possible to have a new function that would
behave like eval(), with the same parameters as
zend_eval_string (I want to be able to specify a name on the
string) ?

Thanx


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-02-23 15:29 UTC] david at guerizec dot net
Hi,

I commented out a few lines from zend_eval_string() and now
it behaves the right way.

Here are the line numbers I removed (corresponding to the
function zend_eval_string):
zend_execute_API.c: 492 to 498, 501.

Note that I'm not especially asking to modify this function,
but to add a new function that would behave like the real
eval() statement.

And it would be good if I this new function is available
before 4.0.5 is out, cause the midgard module relies on it.

Thanks
 [2001-02-23 18:13 UTC] david at guerizec dot net
I've found a workaround, it's to replicate the function
zend_eval_string() in my own module, less the few lines that
pose problem.

I consider this as a workaround only, since I'm not sure if
the code used in that function follows the exact Zend API,
so I will let this feature request open. 
 [2010-12-31 20:15 UTC] jani@php.net
-Package: Feature/Change Request +Package: Scripting Engine problem
 [2013-07-30 03:37 UTC] yohgaki@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: yohgaki
 [2013-07-30 03:37 UTC] yohgaki@php.net
It seems current master does not have this issue.
Please reopen if there is.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 10:01:28 2024 UTC