__CLASS__ and debug_backtrace()

From: Date: Wed, 10 Jul 2002 19:48:29 +0000
Subject: __CLASS__ and debug_backtrace()
Groups: php.dev 
Request: Send a blank email to php-dev+get-85896@lists.php.net to get a copy of this message
While experimenting with php-4.3.0 alpha, i discovered this. Both __CLASS__ and debug_backtrace() give the wrong class name in the below program and they do so whether the method is called statically or on an instance. Is this a bug or the desired behavour? If the latter, wouldn't it be more useful if it gave the child class name? <? class base { function print_something() { echo __CLASS__."\n"; print_r(debug_backtrace()); } } class child extends base {} child::print_something(); $c = new child(); $c->print_something(); ?> Phil Dier <phil@gettcomm.com> gett communications <http://www.gettcomm.com> gett labs, inc. <http://www.gettlabs.com>

« previous php.dev (#85896) next »