Asf_Debug_Dump::vars

(推荐使用) 美化打印变量的相关信息

比原生的PHP函数 var_dump 的输出结果更加便于阅读

备注: CLI模式也同样支持输出美化


Description

public static string Asf_Debug_Dump::vars(mixed $expression [, mixed $... ])

Return Values

没有返回值

Examples

Example #1

<?php
define('VER_STR', 'VERSION_ID_100');

$b_check = false;
$b_check_1 = true;
$n_check = null;
$i_check = 100;
$d_check = 100.05;
$s_check = 'This is Asf';

$a_check = array(
    'aaa',
    'bbb' => array(
        'aaa_1' => 100,
        'bbb_1' => array(
        'ccc_2',
        'ccc_3' => 'world',
        'ccc_4' => VER_STR
        )
    ),
    'a' => false,
    'b' => true,
    'c' => null,
    'd' => 100.05,
    '"dd' => '100.01'
);

$r_check = fopen(__DIR__ . '/077.phpt', 'r');

Asf_Debug_Dump::vars($b_check, $b_check_1, $n_check, $i_check, $d_check, $s_check, $a_check, $r_check);

fclose($r_check);

The above example will output:

/php-path/Example.php:496
boolean false
boolean true
null
int 100
float 100.05
string 'This is Asf' (len=11)
array (size=7) {
   0 => string 'aaa' (len=3)
   'bbb' => array (size=2) {
     'aaa_1' => int 100
      'bbb_1' => array (size=3) {
        0 => string 'ccc_2' (len=5)
        'ccc_3' => string 'world' (len=5)
        'ccc_4' => string 'VERSION_ID_100' (len=14)
    }
  }
  'a' => boolean false
  'b' => boolean true
  'c' => null
  'd' => float 100.05
  '"dd' => string '100.01' (len=6)
}
resource(6) of type (stream)