Changeset 55 for trunk/Packages/Common/VarDumper.php
- Timestamp:
- Apr 7, 2020, 12:55:39 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Packages/Common/VarDumper.php
r37 r55 49 49 self::$_depth=$depth; 50 50 self::dumpInternal($var,0); 51 if ($highlight)51 if ($highlight) 52 52 { 53 53 $result=highlight_string("<?php\n".self::$_output,true); … … 60 60 private static function dumpInternal($var,$level) 61 61 { 62 switch (gettype($var))62 switch (gettype($var)) 63 63 { 64 64 case 'boolean': … … 84 84 break; 85 85 case 'array': 86 if (self::$_depth<=$level)86 if (self::$_depth<=$level) 87 87 self::$_output.='array(...)'; 88 else if (empty($var))88 else if (empty($var)) 89 89 self::$_output.='array()'; 90 90 else … … 93 93 $spaces=str_repeat(' ',$level*4); 94 94 self::$_output.="array\n".$spaces.'('; 95 foreach ($keys as $key)95 foreach ($keys as $key) 96 96 { 97 97 self::$_output.="\n".$spaces." [$key] => "; … … 102 102 break; 103 103 case 'object': 104 if (($id=array_search($var,self::$_objects,true))!==false)104 if (($id=array_search($var,self::$_objects,true))!==false) 105 105 self::$_output.=get_class($var).'#'.($id+1).'(...)'; 106 else if (self::$_depth<=$level)106 else if (self::$_depth<=$level) 107 107 self::$_output.=get_class($var).'(...)'; 108 108 else … … 114 114 $spaces=str_repeat(' ',$level*4); 115 115 self::$_output.="$className#$id\n".$spaces.'('; 116 foreach ($keys as $key)116 foreach ($keys as $key) 117 117 { 118 118 $keyDisplay=strtr(trim($key),array("\0"=>':'));
Note:
See TracChangeset
for help on using the changeset viewer.