<?php
class TestClass {
function test_method($str) {
var_dump( debug_backtrace() );
}
}
function test_func($param1, $param2) {
$obj = new TestClass();
$obj->test_method("ABC");
}
test_func("ZZZ","XXX");
?>
●実行結果
array(2) {
[0]=>
array(7) {
["file"]=>
string(21) "C:\php\develop\t1.php"
["line"]=>
int(10)
["function"]=>
string(11) "test_method"
["class"]=>
string(9) "TestClass"
["object"]=>
object(TestClass)#1 (0) {
}
["type"]=>
string(2) "->"
["args"]=>
array(1) {
[0]=>
&string(3) "ABC"
}
}
[1]=>
array(4) {
["file"]=>
string(21) "C:\php\develop\t1.php"
["line"]=>
int(13)
["function"]=>
string(9) "test_func"
["args"]=>
array(2) {
[0]=>
&string(3) "ZZZ"
[1]=>
&string(3) "XXX"
}
}
}
|