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, but never
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 rule, I think...
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
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 what
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
5 matches
Mail list logo