<?php class A { public function testMethod() { if(method_exists(static::class, 'toBeOverwritten')) { var_dump('method overwritten'); } else { var_dump('method not overwritten'); } } public function toBeOverwritten(){} } class B extends A { public function callTestMethod() { $this->testMethod(); } } (new B)->callTestMethod();
You have javascript disabled. You will not be able to edit any code.