|  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
Have you experienced this issue?
Rate the importance of this bug to you:

 [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-2020 The PHP Group
All rights reserved.
Last updated: Wed Dec 02 19:01:24 2020 UTC