This article mainly introduces the debugging information about the debug_backtrace() function print call in PHP. It has a certain reference value. Now I share it with you. Friends in need can refer to it
(PHP 4 >= 4.3.0, PHP 5, PHP 7)
debug_backtrace — Generate a backtrace
##array debug_backtrace ([ int $options = DEBUG_BACKTRACE_PROVIDE_OBJECT [, int $limit
= 0 ]] )
Parameters
Whether to fill in "object" index. | |
Whether to ignore the index of "args", including all function/method parameters, can save memory overhead. |
or FALSE
, which were respectively equal to whether to set DEBUG_BACKTRACE_PROVIDE_OBJECT
option.
=0
), which returns all stack frames.
Elements that may be returned from
Type | Description | |
---|---|---|
string | The current function name, see: __FUNCTION__. | |
integer | The current line number. See: __LINE__. | |
string | The current file name. See: __FILE__. | |
string | The name of the current class. See __CLASS__ | |
object | the current object. | |
string | The type of the current call. If it is a method, "->" will be returned. If it is a static method, "::" will be returned. If it is a function call, returns null. | |
array | If inside a function, this will list the parameters of the function. If it is in an included file, the included file name will be listed. |
Description | |
---|---|
Added optional parameter | limit.
|
The parameter | provide_object was changed to options , and the optional parameter DEBUG_BACKTRACE_IGNORE_ARGS# was added ##.
| 5.2.5
provide_object | .
| 5.1.1
object as a possible returned element. |
The above is the detailed content of About the debug_backtrace() function in PHP that prints debugging information at the call location. For more information, please follow other related articles on the PHP Chinese website!