Home >Backend Development >PHP Tutorial >PHP implements printing the entry address of the calling function

PHP implements printing the entry address of the calling function

小云云
小云云Original
2018-03-17 09:05:502292browse


This article mainly shares with you the PHP printing call function entry address (stack). It mainly explains it to you with a small piece of code. I hope it can help you.

    private function print_stack_trace()
    {
        $array = debug_backtrace();
        //print_r($array);//信息很齐全
        unset($array[0]);
        foreach ($array as $row) {
            $html .= $row['file'] . ':' . $row['line'] . '行,调用方法:' . $row['function'] . "

"; } } Return $html; }


Related recommendations:

PHP prints the calling function entry address (stack) for easy debugging

The above is the detailed content of PHP implements printing the entry address of the calling function. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn