"This article introduces you to a code debugging artifact debug_backtrace
"
Preface
#When reading the source code, Kaka always uses the editor to track the code, but sometimes there is a problem when going back.
Even if the editor provides a fallback route for code tracking, sometimes it still takes a while to check it.
I accidentally discovered a PHP debugging function debug_backtrace
.
This function can clearly see the execution route of the code (provided that the code is changed to a certain extent).
Next, Kaka will briefly explain and revise this function to create its own development tool.
1. Instructions for use of debug_backtrace
The following picture is the debugging made by Kaka when debugging and detecting routing grouping. .
The execution roadmap of this code was also drawn by Kaka using a mind map. Please see the picture below.
Let’s use this artifact in the code and see what happens.
The method of use is to assign this function to a variable and then print the variable.
Pay attention to the printed results. There are file names, line numbers, method names, and class names, but there will still be some useless ones. Things (useless here refers to personal circumstances, but it is very clear and convenient when looking at the class information).
Simple processing of the artifact
At present, only a few clicks are needed A simple message is enough. The code adapted by Kaka is as follows.
Redefine a variable and store only the required information, then use the inversion of the array.
Then you can clearly see the execution process by looking at the print results.
After debugging, it is consistent with the route drawn by Kaka using mind mapping.
“Persistence in learning, persistence in blogging, and persistence in sharing are the beliefs that Kaka has always upheld since his career. I hope Kaka’s article on Nuoda Internet can bring you a little bit of help. I’m Kaka, see you next time.
”
The above is the detailed content of The best tool for reading ThinkPHP source code debug_backtrace. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

WebStorm Mac version
Useful JavaScript development tools

Atom editor mac version download
The most popular open source editor

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software