debug_backtrace

<?php

one();

function one() {
two();
}

function two() {
three();
}

function three() {
print_r( debug_backtrace() );
}

Array
(
[0] => Array
(
[file] => /usercode/file.php
[line] => 10
[function] => three
[args] => Array
(
)

    )

[1] => Array
    (
        [file] => /usercode/file.php
        [line] => 6
        [function] => two
        [args] => Array
            (
            )

    )

[2] => Array
    (
        [file] => /usercode/file.php
        [line] => 3
        [function] => one
        [args] => Array
            (
            )

    )

)

猜你喜欢

转载自www.cnblogs.com/2018-05-9-ygk/p/10783638.html