php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #47454 provide a function to get caller scope
Submitted: 2009-02-19 22:28 UTC Modified: 2009-02-22 15:03 UTC
From: wesley dot gunn at email dot it Assigned:
Status: Closed Package: Feature/Change Request
PHP Version: 5.3.0beta1 OS: irrelevant
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: wesley dot gunn at email dot it
New email:
PHP Version: OS:

 

 [2009-02-19 22:28 UTC] 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


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-02-20 01:13 UTC] wesley dot gunn at email dot it
i'm sorry... resolved!

debug_backtrace();

i'm sorry!!!

thank you anyway!
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon May 06 08:01:33 2024 UTC