Eval statements in functions.
Posted: Tue Oct 30, 2007 10:25 pm
scottayy | Please use
I would prefer to have the eval statement inside of my function and just use this code:
Any simple way to do this?
scottayy | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Eval statements executed within functions only have access to local variables. For a few classes this has caused me to use code like the following:Code: Select all
eval($class->method($var));Code: Select all
$class->method($var);scottayy | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]