Re: [PHP] Using Static Class Variables to Access Globally

2008-09-24 Thread Eric Butera
On Tue, Sep 23, 2008 at 9:03 PM, Ryan Panning <[EMAIL PROTECTED]> wrote: > The typical way to access a variable or instance from inside a > function/method is to either declare it a global variable or pass it as a > argument. Is there any reason why someone shouldn't use static class > variables to

Re: [PHP] Using Static Class Variables to Access Globally

2008-09-23 Thread Ryan Panning
Nathan Nobbe wrote: in many cases, people like to drive client code through methods, which, given the current set of language features in php, could be reason to favor a singleton w/ __get() & __set() methods defined. you still have the same 'global' scope, except that the data doesnt have to be

Re: [PHP] Using Static Class Variables to Access Globally

2008-09-23 Thread Nathan Nobbe
On Tue, Sep 23, 2008 at 7:03 PM, Ryan Panning <[EMAIL PROTECTED]> wrote: > The typical way to access a variable or instance from inside a > function/method is to either declare it a global variable or pass it as a > argument. Is there any reason why someone shouldn't use static class > variables t

RE: [PHP] Using Static Class Variables to Access Globally

2008-09-23 Thread Richard Lynch
> -Original Message- > From: Ryan Panning [mailto:[EMAIL PROTECTED] > Sent: Tuesday, September 23, 2008 8:03 PM > To: php-general@lists.php.net > Subject: [PHP] Using Static Class Variables to Access Globally > > The typical way to access a variable or instance fro

[PHP] Using Static Class Variables to Access Globally

2008-09-23 Thread Ryan Panning
The typical way to access a variable or instance from inside a function/method is to either declare it a global variable or pass it as a argument. Is there any reason why someone shouldn't use static class variables to do this? Ex: do_something(); } foo_bar(); ?> Crude example but imagine th