- debug_backtrace: documentation ( source)
- print_r: documentation ( source)
<?php
class foo
{
public function test1()
{
echo foo::class . "\n";
return (object) ['foo::test' => 'test', 'body' => 'content'];
}
public function test()
{
print_r(debug_backtrace());
return $this;
}
}
class bar extends foo{
public function aa(){
return $this->test();
}
}
$bar = new bar();
$bar->aa();