Re: Re: Accessing a variable from inside a local function
| From: | Frank Munch | Date: | Wed, 28 Jul 2004 11:49:08 +0000 |
| Subject: | Re: Re: Accessing a variable from inside a local function | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-192088@lists.php.net to get a copy of this message | ||
Thanks for the good suggestion, a fully usable workaround if a "cleaner" thing doesn't surface.
And for your response time.. well, I have had slower answers in phone-conversations... :-)
At 06:37 PM 7/28/2004, Jason Barnett wrote:
Something like this is probably better handled by a class. Then you can access class properties to do what you want. Class yourclass { function foo() {$this->my_foo_local = 10;} function bar($var_bar) {return $this->my_foo_local+$var_bar+1;} } $object = new yourclass(); $object->foo(); echo $object->bar(12); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php