<?php class BaseClass { public static function getText() { return "base class"; } public function printWithSelf() { print self::getText(); } public function printWithStatic() { print static::getText(); } } class ExtendedClass extends BaseClass { public static function getText() { return "extended class"; } } $instance = new ExtendedClass(); $instance->printWithSelf(); print "\n"; $instance->printWithStatic();
You have javascript disabled. You will not be able to edit any code.