<?php class MyObject { static function myMethod() { static::myOtherMethod(); } static function myOtherMethod() { echo "called from MyObject"; } } class MyOtherObject extends MyObject { static function myOtherMethod() { echo 'called from MyOtherObject'; } } MyOtherObject::myMethod();
<?php class MyObject { function myMethod() { echo "Standard Functionality\n"; } } class MyOtherObject extends MyObject { function myMethod() { echo "New Functionality"; parent::myMethod(); } } $obj = new MyOtherObject(); $obj->myMethod();