Aer/tests/debug_backtrace.aer

22 lines
409 B
Plaintext
Raw Normal View History

class Program {
2018-08-07 15:47:14 +02:00
function main() {
2018-08-07 15:47:14 +02:00
$this->b($this->a('First A'), $this->a('Second A'), $this->a('Third A'));
}
2018-09-14 21:32:08 +02:00
function a(string $p) {
2018-09-23 17:51:47 +02:00
mixed $backtrace = debug_backtrace();
2018-08-07 15:47:14 +02:00
if(isset($backtrace[0]['args'])) {
var_export($backtrace[0]['args']);
} else {
print("Cannot aquire arguments\n");
}
return $p;
}
2018-09-14 21:32:08 +02:00
function b(string $p1, string $p2, string $p3) {
2018-08-07 15:47:14 +02:00
print("$p1, $p2, $p3");
}
}