PHP implements printing the entry address of the calling function

小云云
Release: 2023-03-21 16:24:02
Original
2279 people have browsed it


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'] . "
Copy after login

"; } } 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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template