Re: [PHP] Re: self:: vs this

2007-05-12 Thread Richard Lynch
On Fri, May 11, 2007 12:28 pm, Eric Butera wrote: > On 5/11/07, M.Sokolewicz <[EMAIL PROTECTED]> wrote: >> statically: >> Class Foo { >> static $a = 1; >> static function Bar() { >>self::a++; >> } >> } Use self:: only when you don't have an actual instance handy, is a general r

Re: [PHP] Re: self:: vs this

2007-05-11 Thread Arpad Ray
M.Sokolewicz wrote: Basically what you can remember here is: :: calls a property or method in a STATIC context (ie. without access to the object's (if any) actual properties) -> calls a propert or method in a DYNAMIC context (ie. WITH access to that specific object's collection of methods and p

Re: [PHP] Re: self:: vs this

2007-05-11 Thread Eric Butera
On 5/11/07, M.Sokolewicz <[EMAIL PROTECTED]> wrote: statically: Class Foo { static $a = 1; static function Bar() { self::a++; } } echo Foo:a; >> 1 Foo::Bar(); // will probably throw a warning, not sure of that though echo Foo:a; >> 1 (no change) I'm not sure I understand