PHP Calling self on a non-static method
Why is the 'self'-call to a non-satic method in this example working? class A{ protected function aNonStaticMethod(){ return __class__; } public function aEcho(){ echo self::aNonStaticMethod(); } } Thanks for explanation. Calling non-static method statically Theoretically it should not work, but as this comment says: There was no static keyword in php4 but php4 did allow for static calls. To maintain backwards compatibility this was left in when the static keyword was added in php5. This comment is supported by this official php.net wiki: This is already deprecated if the call occurs from an