Re: "::" meaning and documentation

From: Date: Mon, 26 Jun 2000 17:13:27 +0000
Subject: Re: "::" meaning and documentation
References: 1 2 3 4  Groups: php.dev 
Request: Send a blank email to php-dev+get-22373@lists.php.net to get a copy of this message
Stefan Livieratos wrote: > > -----Ursprüngliche Nachricht----- > Von: Chuck Hagenbuch <chagenbu@wso.williams.edu> > An: Stefan Livieratos <stefan@livieratos.com> > Cc: Ulf Wendel <ulf@redsys.de>; <php-dev@lists.php.net> > Gesendet: Montag, 26. Juni 2000 18:25 > Betreff: Re: [PHP-DEV] "::" meaning and documentation > > > Quoting Stefan Livieratos <stefan@livieratos.com>: > > > > > 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

« previous php.dev (#22373) next »