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

[PHP] Re: self:: vs this

2007-05-12 Thread itoctopus
self:: static functions $this-> non static functions -- itoctopus - http://www.itoctopus.com "Mariano Guadagnini" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hy people, > I have an existential doubt regarding php classes. I have been a php > programmer for quite a long time, bu

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

[PHP] Re: self:: vs this

2007-05-11 Thread M.Sokolewicz
Mariano Guadagnini wrote: Hy people, I have an existential doubt regarding php classes. I have been a php programmer for quite a long time, but never could figure out the clear difference between using this-> or self:: when calling member functions, wether they are private or public. I used th