|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-11-17 17:55 UTC] tony2001@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 01:00:01 2025 UTC |
Description: ------------ __CLASS__ does not contain the correct class name in a generic class if method is called from a derived class. Reproduce code: --------------- <?php class Generic { public static function i_am() { print __CLASS__ . "\n"; } } class Derived extends Generic { } Generic::i_am(); // correct, print "Generic" Derived::i_am(); // wrong, should print "Derived" ?> Expected result: ---------------- If I call a method which was implemented in a parent class I need in any way access to the name of the class which actually was asked to execute the method... Actual result: -------------- Always the name of the class that actualy implements the method.