#47454 [Opn->Csd]: provide a function to get caller scope
| From: | kalle@php.net | Date: | Sun, 22 Feb 2009 15:03:08 +0000 |
| Subject: | #47454 [Opn->Csd]: provide a function to get caller scope | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-134086@lists.php.net to get a copy of this message | ||
ID: 47454
Updated by: kalle@php.net
Reported By: wesley dot gunn at email dot it
-Status: Open
+Status: Closed
Bug Type: Feature/Change Request
Operating System: irrelevant
PHP Version: 5.3.0beta1
Previous Comments:
------------------------------------------------------------------------
[2009-02-20 01:13:55] wesley dot gunn at email dot it
i'm sorry... resolved!
debug_backtrace();
i'm sorry!!!
thank you anyway!
------------------------------------------------------------------------
[2009-02-19 22:28:22] wesley dot gunn at email dot it
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
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=47454&edit=1