Quoting "Arno A. Karner" <[EMAIL PROTECTED]>:

> i dissagree $this in a static object should point to the default
> declared object,
> and if that is unacceptable because u want the the default data to be
> read only,
> then it should be allowed for methods at least.

It is unacceptable because it breaks all kinds of rules and expectations about 
scope, and how objects work.

> but either way $this needs to be accessable in static functions or there
> not wothless but not worth as much as they could and should be

No. $this is - well, should be - meaningless in a static class. If an object 
isn't instantiated, there is no $this. It should be that simple. Having static 
class variables would be nice, but the current behavior is not a solution for 
them.

To give a more concrete example of why the current behavior is bad, imagine 
that you have a function that you'd like to be able to be call statically or 
from within the object. If you call it statically, you want to instantiate an 
object and then call the method on that object. The obvious way to figure out 
whether or not you're in a static call is to check for the existance of $this. 
But with the current behavior, you can't do that, because if you happen to be 
calling the static method from within a _completely different_ object, $this 
will be defined.

Note that the above confused the hell out of me for several hours as I tried to 
figure out why Mail_RFC822::parseAddressList() suddenly stopped working when I 
called it from within Mail::send().

-chuck

--
Charles Hagenbuch, <[EMAIL PROTECTED]>
"My intuitive grasp of math often leads me astray." -Me

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to