How to get the child name from within the parent?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello there,

Is there a way to get the child class name from within the parent method?

If so, how?

Thx in advance.

Example:

class MyParent {
 public static function start() {
  // Do something like this???
  return get_child_name(); // returns 'MyChild' in this case
 }
}

class MyChild extends MyParent {
 public static childStart() {
  // Should return the child class name.
  echo parent::start();
 }
}

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux