Browse Source

Test debug_backtrace() function

pull/44/head
Rafal Kupiec 3 years ago
parent
commit
80f376af62
Signed by: belliash GPG Key ID: 4E829243E0CFE6B4
2 changed files with 36 additions and 0 deletions
  1. +23
    -0
      tests/debug_backtrace.aer
  2. +13
    -0
      tests/debug_backtrace.exp

+ 23
- 0
tests/debug_backtrace.aer View File

@ -0,0 +1,23 @@
class Main {
function __construct() {
$this->b($this->a('First A'), $this->a('Second A'), $this->a('Third A'));
}
function a($p) {
$backtrace = debug_backtrace();
if(isset($backtrace[0]['args'])) {
var_export($backtrace[0]['args']);
} else {
print("Cannot aquire arguments\n");
}
return $p;
}
function b($p1, $p2, $p3) {
print("$p1, $p2, $p3");
}
}
new Main();

+ 13
- 0
tests/debug_backtrace.exp View File

@ -0,0 +1,13 @@
Array(1) {
[0] =>
First A
}
Array(1) {
[0] =>
Second A
}
Array(1) {
[0] =>
Third A
}
First A, Second A, Third A

Loading…
Cancel
Save