From:             wildmaple at yahoo dot com
Operating system: linux
PHP version:      5.0.3
PHP Bug Type:     Class/Object related
Bug description:  get_class() with no argument, always return the original 
classname

Description:
------------
get_class() invoked with no argument, always return the original
classname, in which it is first referenced.

Reproduce code:
---------------
#!/bin/php

<?php


class parentCls{
        static function initPStatic(){
                echo("parentCls::initPStatic said
get_class()=='".get_class()."'\n");
                echo("\n");
        }
        function initP(){
                echo("parentCls::initP said
get_class()=='".get_class()."'\n");
                echo("\n");
        }
}

class childCls extends parentCls{
}

childCls::initPStatic();
$c=new childCls();
$c->initP();

?>

Expected result:
----------------
parentCls::initPStatic said get_class()=='childCls'

parentCls::initP said get_class()=='childCls'

Actual result:
--------------
parentCls::initPStatic said get_class()=='parentCls'

parentCls::initP said get_class()=='parentCls'

-- 
Edit bug report at http://bugs.php.net/?id=31716&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=31716&r=trysnapshot4
Try a CVS snapshot (php5.0): 
http://bugs.php.net/fix.php?id=31716&r=trysnapshot50
Try a CVS snapshot (php5.1): 
http://bugs.php.net/fix.php?id=31716&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=31716&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=31716&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=31716&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=31716&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=31716&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=31716&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=31716&r=notwrong
Not enough info:             
http://bugs.php.net/fix.php?id=31716&r=notenoughinfo
Submitted twice:             
http://bugs.php.net/fix.php?id=31716&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=31716&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=31716&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=31716&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=31716&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=31716&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=31716&r=float
No Zend Extensions:          http://bugs.php.net/fix.php?id=31716&r=nozend
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=31716&r=mysqlcfg

Reply via email to