|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #34210 Feature to run function inline within the local scope
Submitted: 2005-08-22 14:42 UTC Modified: 2016-12-30 23:01 UTC
Avg. Score:2.0 ± 0.0
Reproduced:0 of 1 (0.0%)
From: jdv at foobar dot be Assigned:
Status: Open Package: Scripting Engine problem
PHP Version: 5.0.4 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
Solve the problem:
32 + 35 = ?
Subscribe to this entry?

 [2005-08-22 14:42 UTC] jdv at foobar dot be
It would be nice to see a feature that allowed for functions to be executed, inline, within the current local scope. The behaviour I intend for is that of eval(). Calling eval($code) allows $code to access variables from the local scope from which eval is called. It also allows $code to set variables in this local scope. Both features, if accessible to user-defined functions, would come in handy on occasions.

One particular useful function that could be built if this functionality existed, would accept a string for argument and replace all %foo occurences in it by the -- according to context -- properly escaped value of $foo. Such a function could then be used for composing HTML and SQL strings more easily.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2016-12-30 23:01 UTC]
-Package: Feature/Change Request +Package: Scripting Engine problem
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Fri Sep 20 01:01:28 2019 UTC