View Single Post
Old 06-14-2010, 03:44 PM   #1 (permalink)
Tanax
The Prestige
Upcoming Programmer Inquisitive 
 
Tanax's Avatar
 
Join Date: Sep 2007
Location: Sweden, Stockholm
Posts: 1,080
Thanks: 115
Tanax is on a distinguished road
Default Getting classname where function was called from

How would I get the classname of a class where I called another class's function?

one.php
PHP Code:
class One
{

     public static function 
test()
     {

          echo 
Two::test();

     }


two.php
PHP Code:
class Two
{

     public static function 
test()
     {

         return 
'You called this from: ' $something;

     }


Calling One::test() would echo out:
You called this from: One, or
You called this from: one.php, or
You called this from: path/to/file/one.php

Is that possible??
__________________
Tanax is offline  
Reply With Quote