getting name of subclass in static methods

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • mydahlia@gmail.com

    #1

    getting name of subclass in static methods

    abstract class A {
    static function i_want_my_child s_name() {
    echo __CLASS__;
    }
    }

    class B extends A { }

    B::i_want_my_ch ilds_name();


    this code prints "A", but i want to get "B". how can i get subclass's
    name in static method?

Working...