Re: Get name of extending class with static method call (PHP5)

From: Date: Wed, 12 Jan 2005 17:34:25 +0000
Subject: Re: Get name of extending class with static method call (PHP5)
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-14360@lists.php.net to get a copy of this message
Torsten: On Wed, Jan 12, 2005 at 04:58:20PM +0100, Torsten Roehr wrote: > How can I get the name of the extending class that invoked the method in > drive()? class Car { function drive($child) { echo "parent driven in a $child\n"; } } class Porsche extends Car { function drive() { parent::drive(get_class()); } } Porsche::drive(); --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409

« previous php.internals (#14360) next »