Re: [PHP-DEV] "::" meaning and documentation From: Ulf Wendel (ulf <email protected>)
Date: 06/26/00

Stefan Livieratos wrote:
>
> -----Ursprüngliche Nachricht-----
> Von: Chuck Hagenbuch <chagenbu <email protected>>
> An: Stefan Livieratos <stefan <email protected>>
> Cc: Ulf Wendel <ulf <email protected>>; <php-dev <email protected>>
> Gesendet: Montag, 26. Juni 2000 18:25
> Betreff: Re: [PHP-DEV] "::" meaning and documentation
>
> > Quoting Stefan Livieratos <stefan <email protected>>:
> >
> > > No side effect. Static method calls were introduced so that in a
> subclass
> > > you can call methods of the parent class.
> >
> > If $this is empty in methods called with the :: notation, then how can you
> > usefully call a method of the parent class? Or is $this magically set to
> the
> > right thing in those cases?
> >
>
> $this is not empty when calling a static method from within a class:

Replace "from within a class" with "from within a derived class" and I
understand the whole thing. But my snippet did not use "::" within a
class but outside any class. I have used it to access a method from
outside the scope.

Do we have different understandings of the term "static"? I thought of
Java's ClassName.staticMethod(parameters); and ClassName.staticFieldName
or of the C++ :: operator, Math::PI . Sorry that I can't get it, answer
via PM if I'm spamming the list.

What is :: good for. Was it made to access methods and fields of a
parentclass that got overriden by a derived class? If that's what it was
made for you should not be allowed to use the :: operator outside a
derived class. If it's a real static method call in the way thats
available in Java the syntax is rotten. How can a method that was called
static rely on the $this object autocreation? I mean it's static, it's
not allowed to work with the object $this ...

Ulf

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: php-dev-unsubscribe <email protected>
For additional commands, e-mail: php-dev-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>