Re: "::" meaning and documentation

From: Date: Mon, 26 Jun 2000 16:43:45 +0000
Subject: Re: "::" meaning and documentation
References: 1 2 3  Groups: php.dev 
Request: Send a blank email to php-dev+get-22366@lists.php.net to get a copy of this message
-----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: --cut-- class foo { var $a = "A"; function doit() { print $this->a; } } class bar extends foo { function doit() { foo::doit(); print "OK"; } } $b = new bar; $b->doit(); --cut-- prints AOK. Regards, Stefan

« previous php.dev (#22366) next »