var_dump:打印变量的相关信息

 

    $a = array(1, 2, array("a", "b", "c"));
    var_dump($a);

//
array (size=3)
0 => int 1
1 => int 2
2 =>
array (size=3)
0 => string 'a' (length=1)
1 => string 'b' (length=1)
2 => string 'c' (length=1)

var_export:输出或返回一个变量的字符串表示

    $a = array(1, 2, array("a", "b", "c"));
    var_export($a);

//
array ( 0 => 1, 1 => 2, 2 => array ( 0 => 'a', 1 => 'b', 2 => 'c', ), )

get_included_files:返回被 include 和 require 文件名的 array

var_dump(get_included_files());

//
array (size=2)
0 => string 'D:\phpStudy\PHPTutorial\WWW\laravel56\public\index.php' (length=54)
1 => string 'D:\phpStudy\PHPTutorial\WWW\laravel56\vendor\autoload.php' (length=57)

debug_backtrace — 产生一条回溯跟踪

<?php
 // filename: /tmp/a.php

function a_test ( \(str</span><span style="color: #000000;"> ) { </span><span style="color: #0000ff;">echo</span> "\nHi: <span style="color: #800080;">\)str " ;
var_dump ( debug_backtrace ());
}

a_test ( 'friend' );
?>

<?php
// filename: /tmp/b.php
include_once '/tmp/a.php' ;
?>

//
Hi: friend
array(2) {
[
0]=>
array(4) {
[
"file"] => string(10) "/tmp/a.php"
[
"line"] => int(10)
[
"function"] => string(6) "a_test"
[
"args"]=>
array(1) {
[
0] => &string(6) "friend"
}
}
[
1]=>
array(4) {
[
"file"] => string(10) "/tmp/b.php"
[
"line"] => int(2)
[
"args"] =>
array(1) {
[
0] => string(10) "/tmp/a.php"
}
[
"function"] => string(12) "include_once"
}
}

debug_print_backtrace — 打印一条回溯。 

<?php
 // include.php file

function a () {
b ();
}

function b () {
c ();
}

function c (){
debug_print_backtrace ();
}

a ();

?>

//

0 c() called at [/tmp/include.php:10]

1 b() called at [/tmp/include.php:6]

2 a() called at [/tmp/include.php:17]

3 include(/tmp/include.php) called at [/tmp/test.php:3]