Test debug_backtrace() function
The build has failed. Details

This commit is contained in:
Rafal Kupiec 2018-08-07 15:47:14 +02:00
parent cdc58f2795
commit 80f376af62
Signed by: belliash
GPG Key ID: 4E829243E0CFE6B4
2 changed files with 36 additions and 0 deletions

23
tests/debug_backtrace.aer Normal file
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
tests/debug_backtrace.exp Normal file
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