NYCPHP Meetup

NYPHP.org

[nycphp-talk] self:: or $this ?

Dan Cech dcech at phpwerx.net
Fri Nov 9 15:34:07 EST 2007


Morgan Craft wrote:
> Any reason why I should use $this->methodName()  over self::methodName()
> Or is the self::methodName() reserved only for working within a static
> method?

The deciding factor is the nature of methodName()

self::methodName() if methodName is static
$this->methodName() if methodName is not static

Dan



More information about the talk mailing list