3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class foo { public static function test() { var_dump(get_called_class()); // var_dump(get_deb // ug(true)); var_dump(debug_backtrace(true)); } } class bar extends foo { } foo::test(); bar::test(); class_alias('bar', 'baz'); baz::test();
Output for 5.3.0 - 7.1.0
string(3) "foo" array(1) { [0]=> array(6) { ["file"]=> string(9) "/in/OvCWJ" ["line"]=> int(17) ["function"]=> string(4) "test" ["class"]=> string(3) "foo" ["type"]=> string(2) "::" ["args"]=> array(0) { } } } string(3) "bar" array(1) { [0]=> array(6) { ["file"]=> string(9) "/in/OvCWJ" ["line"]=> int(18) ["function"]=> string(4) "test" ["class"]=> string(3) "foo" ["type"]=> string(2) "::" ["args"]=> array(0) { } } } string(3) "bar" array(1) { [0]=> array(6) { ["file"]=> string(9) "/in/OvCWJ" ["line"]=> int(20) ["function"]=> string(4) "test" ["class"]=> string(3) "foo" ["type"]=> string(2) "::" ["args"]=> array(0) { } } }