inherited scope in a function (CFPARAM)
From: Indrid Cold (nobody_at_nowhere.com)
Date: 02/29/04
- Next message: Andy Hassall: "Re: inherited scope in a function (CFPARAM)"
- Previous message: John Dunlop: "Re: regular expression question: any character except a white space?"
- Next in thread: Andy Hassall: "Re: inherited scope in a function (CFPARAM)"
- Reply: Andy Hassall: "Re: inherited scope in a function (CFPARAM)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sun, 29 Feb 2004 15:44:40 GMT
Is there a way to call a function so the function shares the scope of the
caller?
For example, I was playing around with making a php version of the cold
fusion tag CFPARAM
What that cold fusion tag/sorta-function does is:
1) Check if a variable exists
2) If it doesn't, creat it with a default value
I could do it inline like this:
eval("if(empty(\$testVar)) \testVar=null;");
but I don't see how I could do it as a function, like say
phParam("test")
... is there any way for php to see all variables in the caller's scope
without passing them in or declaring them all global?
- Next message: Andy Hassall: "Re: inherited scope in a function (CFPARAM)"
- Previous message: John Dunlop: "Re: regular expression question: any character except a white space?"
- Next in thread: Andy Hassall: "Re: inherited scope in a function (CFPARAM)"
- Reply: Andy Hassall: "Re: inherited scope in a function (CFPARAM)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|