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
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
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
> -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
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
5 matches
Mail list logo