Re: Re: Get name of extending class with static method call
| From: | Daniel Schierbeck | Date: | Tue, 11 Jan 2005 22:02:20 +0000 |
| Subject: | Re: Re: Get name of extending class with static method call | ||
| References: | 1 2 3 4 5 6 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-206115@lists.php.net to get a copy of this message | ||
Christopher Fulton wrote:
This should work for you then....(maybe...i don't have php5 on my
system, so it may not, but i think it would.
http://us4.php.net/manual/en/function.get-class.php
class Car {
function drive() {
return get_class($this);
}
}
class Porshe {
}
$foo = new Porshe();
echo $foo->drive();
He needs a static function, ie Porche::drive()