Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function get_cc()
- {
- foreach (debug_backtrace() as $call) {
- if (!isset($call['class'])) {
- continue;
- }
- return $call['class'];
- }
- }
- class Foo
- {
- public function bar()
- {
- dump(get_cc());
- }
- public static function baz()
- {
- dump(get_cc());
- }
- }
- $foo = new Foo;
- $foo->bar();
- Foo::baz();
Advertisement
Add Comment
Please, Sign In to add comment