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               <[EMAIL PROTECTED]>
gett communications  <http://www.gettcomm.com>
gett labs, inc.  <http://www.gettlabs.com>


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to