php.net |  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
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
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: jdv at foobar dot be
New email:
PHP Version: OS:

 

 [2005-08-22 14:42 UTC] jdv at foobar dot be
Description:
------------
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.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-12-30 23:01 UTC] cmb@php.net
-Package: Feature/Change Request +Package: Scripting Engine problem
 
PHP Copyright © 2001-2017 The PHP Group
All rights reserved.
Last updated: Sun Nov 19 01:31:42 2017 UTC