|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-12-16 18:44 UTC] johannes@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Dec 17 08:00:01 2025 UTC |
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