欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

debug_backtrace

程序员文章站 2022-05-13 21:25:06
...

<?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
            (
            )

    )

)

上一篇: PHP基础

下一篇: PHP基础 -- 简答