On Tue, Sep 23, 2008 at 10:41 AM, Micah Gersten <[EMAIL PROTECTED]> wrote:

>
> Eric Butera wrote:
> > On Tue, Sep 23, 2008 at 12:26 PM, Jochem Maas <[EMAIL PROTECTED]>
> wrote:
> >
> >> (using $this->foo or MyClass::$foo for static properties).
> >>
> >
> > also self::
> >
> >
> Actually within a class, I think you must self:: before a static
> property or something shows up in the error log.


yea, php will think its a local variable if not qualified w/ the self
keyword and scope resolution (or w/e its called in php :D), but the name of
the class and the scope resolution operator works as well.  its just a hair
less flexible because if the class name changes you have to update some code
whereas w/ self, the code is no longer dependent upon the class name.

/// psuedocode !
class A {
protected static $someStatic = 5;

public function doStuff() {
  $someStatic  // php thinks this is a local var
  self::$someStatic  // php can id this as a static var
  A::$someStatic  // php can id this as a static var
}

-nathan

Reply via email to