Aer/tests/debug_backtrace.aer

22 lines
419 B
Plaintext
Raw Permalink Normal View History

class Program {
2018-08-07 15:47:14 +02:00
public void main() {
2018-08-07 15:47:14 +02:00
$this->b($this->a('First A'), $this->a('Second A'), $this->a('Third A'));
}
2019-03-17 19:48:52 +01:00
string a(string $p) {
2019-02-05 19:26:06 +01:00
mixed[] $backtrace = debug_backtrace();
2019-03-23 23:25:00 +01:00
if(array_key_exists('args', $backtrace[0])) {
2018-08-07 15:47:14 +02:00
var_export($backtrace[0]['args']);
} else {
print("Cannot aquire arguments\n");
}
return $p;
}
2019-03-17 19:48:52 +01:00
void b(string $p1, string $p2, string $p3) {
2018-08-07 15:47:14 +02:00
print("$p1, $p2, $p3");
}
}