6
Çocuk sınıfında bir işlev gerektirmeden bunu gerçekleştirmeye çalışıyorum ... bu mümkün mü? Kullanım get_called_class()
yerine __CLASS__
...A sınıfı sınıftan alt sınıf adı nasıl alınır
<?php
class A {
public static function who() {
echo __CLASS__;
}
public static function test() {
static::who(); // Here comes Late Static Bindings
}
}
class B extends A {
public static function who() {
echo __CLASS__;
}
}
B::test(); //returns B
?>