Re: Re: Static weirdness..

From: Date: Wed, 18 Feb 2004 18:19:14 +0000
Subject: Re: Re: Static weirdness..
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-7969@lists.php.net to get a copy of this message
On 18 Feb 2004 at 12:33, John Coggeshall wrote: > No. There is *no* reason why static methods should be called from an > object context. Doing so is more than a notice -- its flat out wrong and > defeats the entire purpose of having static in the first place... I agree with John. I would even go one step further and trigger a "call to undefined function" error. I would strictly separate the class scope from the instance scope, allowing both a static method and a normal method with the same name: class Example { static function dump() { print "This is the Example class.\n"; } function dump() { print "This is an Example object:\n"; var_dump($this); } } But I could live without that since it would certainly be very much work to implement such a change... -- Ferdinand Beyer <fb@fbeyer.com>

« previous php.internals (#7969) next »