#47316 [Opn->Bgs]: static get_class() problem with parent/child

From: Date: Thu, 05 Feb 2009 21:09:59 +0000
Subject: #47316 [Opn->Bgs]: static get_class() problem with parent/child
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-133544@lists.php.net to get a copy of this message
ID: 47316 Updated by: jani@php.net Reported By: john dot oconnor at totemic dot co dot uk -Status: Open +Status: Bogus Bug Type: Scripting Engine problem Operating System: Linux PHP Version: 5.2.8 New Comment: It's still defined in Bar. No bug here. Previous Comments: ------------------------------------------------------------------------ [2009-02-05 15:11:17] john dot oconnor at totemic dot co dot uk 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 this bug report at http://bugs.php.net/?id=47316&edit=1

« previous php.bugs (#133544) next »