Re: Class not used as an object (Scope Resolution Operator)

From: Date: Thu, 09 Jun 2011 23:23:45 +0000
Subject: Re: Class not used as an object (Scope Resolution Operator)
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-313491@lists.php.net to get a copy of this message
All of the above with a clarification: they are instance methods which you are calling statically. The object is not instantiated in this case. PHP allows this but will issue an E_STRICT warning. To remove the warning just add "static" before each of them, assuming they are only ever called statically: class myClass { static function &doThis($passedVar) { doSomething; } static function &doThat($anotherVar) { doSomethingElse; } } David

« previous php.general (#313491) next »