С каких пор PHP позволяет вызывать статическую функцию как динамическую функцию?
Я использую php 5.3.2
class weird{ public static function iamstatic($calledFrom){ echo "I am a static function called with a $calledFrom operator\n"; } public function test(){ self::iamstatic("static"); $this->iamstatic("dynamic"); } } $c = new weird(); $c->test(); weird::iamstatic("Static outside class"); $c->iamstatic("Dynamic outside class");
Эти результаты:
I am a static function called with a static operator I am a static function called with a dynamic operator I am a static function called with a Static outside class operator I am a static function called with a Dynamic outside class operator