#47316 [NEW]: static get_class() problem with parent/child
| From: | john dot oconnor at totemic dot co dot uk | Date: | Thu, 05 Feb 2009 15:11:18 +0000 |
| Subject: | #47316 [NEW]: static get_class() problem with parent/child | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-133537@lists.php.net to get a copy of this message | ||
From: john dot oconnor at totemic dot co dot uk
Operating system: Linux
PHP version: 5.2.8
PHP Bug Type: Unknown/Other Function
Bug description: static get_class() problem with parent/child
Description:
------------
When calling a function in a static context, it appears that get_class
reports its class incorrectly.
Reproduce code:
---------------
class Foo extends Bar
{
}
class Bar
{
function test()
{
return get_class(new self);
}
}
print "Should report 'Foo': " . Foo::test();
print "Should report 'Bar': " . Bar::test();
Expected result:
----------------
Should report 'Foo': Foo
Should report 'Bar': Bar
Actual result:
--------------
Should report 'Foo': Bar
Should report 'Bar': Bar
--
Edit bug report at http://bugs.php.net/?id=47316&edit=1
--
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=47316&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=47316&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=47316&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=47316&r=fixedcvs
Fixed in CVS and need be documented: http://bugs.php.net/fix.php?id=47316&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=47316&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=47316&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=47316&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=47316&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=47316&r=support
Expected behavior: http://bugs.php.net/fix.php?id=47316&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=47316&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=47316&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=47316&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=47316&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=47316&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=47316&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=47316&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=47316&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=47316&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=47316&r=mysqlcfg