Lets say I have:
class Zebra{
public static function action(){
print 'I was called from the '.get_class().' class'; // How do I get water here?
}
}
class Water{
public static function drink(){
Zebra::action();
}
}
Water::drink();
How do I get “water” from the zebra class?
(This is for php 5.3)
One not so good solution is :
use
__METHOD__or__FUNCTION__or__CLASS__.and pass it as parameter to function being called.
http://codepad.org/AVG0Taq7