#43608 [NEW]: get_class() gets __CLASS__ in static methods

From: Date: Sun, 16 Dec 2007 18:26:48 +0000
Subject: #43608 [NEW]: get_class() gets __CLASS__ in static methods
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-120679@lists.php.net to get a copy of this message
From: mrbizkit at email dot it Operating system: * PHP version: 5.2.5 PHP Bug Type: Feature/Change Request Bug description: get_class() gets __CLASS__ in static methods Description: ------------ hi, i'm asking for a feature change about this function in static methods and extended classes (please read the reproduce code) the problem is: i want to get the caller classname, not the classname where get_class() is used if you want to fix it [?] for retrocompatibility issues you can use get_class(NULL[,true]); or a new function Reproduce code: --------------- class theparent { public static function test() { echo get_class() . "\n"; //echo get_class(NULL,TRUE) . "\n"; [?] } } class pecl extends theparent{} class pear extends theparent{} pecl::test(); pear::test(); Expected result: ---------------- pecl pear Actual result: -------------- theparent theparent -- Edit bug report at http://bugs.php.net/?id=43608&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=43608&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=43608&r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=43608&r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=43608&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=43608&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=43608&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=43608&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=43608&r=needscript Try newer version: http://bugs.php.net/fix.php?id=43608&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=43608&r=support Expected behavior: http://bugs.php.net/fix.php?id=43608&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=43608&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=43608&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=43608&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=43608&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=43608&r=dst IIS Stability: http://bugs.php.net/fix.php?id=43608&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=43608&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=43608&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=43608&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=43608&r=mysqlcfg

« previous php.bugs (#120679) next »