|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-02-20 01:13 UTC] wesley dot gunn at email dot it
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 20:00:01 2025 UTC |
Description: ------------ hello, i'm building a test/debug framework for my apps i think can be useful a function that provides the caller scope of a certain function/method thank you Reproduce code: --------------- namespace; echo get_caller_scope(); // returns "\" global scope namespace Test\A; echo get_caller_scope(); // returns Test\A class CallerTest { public static function gimme(){echo get_caller_scope();} public static function launch(){self::test();} } Test::gimme(); // returns Test\A Test::launch(); // returns Test\A\CallerTest