<?php class Base { public static function __callStatic($method, $args) { $klass = get_called_class(); echo "class {$klass}\n"; } } class Derived extends Base { } Base::foo(); Derived::foo();
<?php abstract class Base { public static function foo() { $a = 2; static::$x; } } class Derived extends Base { public static $x; } $a = new Derived(); $a->foo(); echo "Done\n";