Dump7
v2.0.2
PHP var_dump เวอร์ชันสวย คลาสนี้แสดงข้อมูลที่มีโครงสร้างเกี่ยวกับการแสดงออกอย่างน้อยหนึ่งรายการที่มีประเภทและค่าของมัน
ตรวจสอบ dump5 สำหรับ php 5+
คุณสามารถดาวน์โหลดเวอร์ชันรุ่นล่าสุดเป็นสแตนด์อโลนหรือคุณสามารถใช้นักแต่งเพลงได้
composer require ghostff/dump7 "require" : {
"ghostff/dump7" : " ^1.0 "
}คุณสามารถซ่อนหรือแสดงแอตทริบิวต์วัตถุบางอย่างโดยใช้ธงบล็อก DOC:
@dumpignore-inheritance | ซ่อนคุณสมบัติคลาสที่สืบทอดมา |
@dumpignore-inherited-class | ซ่อนชื่อคลาสจากคุณสมบัติที่สืบทอดมา |
@dumpignore-private | แสดงคุณสมบัติทั้งหมดยกเว้น ส่วนตัว |
@dumpignore-protected | แสดงคุณสมบัติทั้งหมดยกเว้นคุณสมบัติที่ ได้รับการปกป้อง |
@dumpignore-public | แสดงคุณสมบัติทั้งหมดยกเว้นที่ สาธารณะ |
@dumpignore | ซ่อนคุณสมบัติความคิดเห็นของหมอเป็นของ |
/**
* @dumpignore-inheritance
* @dumpignore-inherited-class
* @dumpignore-private
* @dumpignore-public
* @dumpignore-public
*/
Class Foo extends Bar {
/** @dumpignore */
private ? BigObject $ foo = null ;
} class FooBar
{
private $ inherited_int = 123 ;
private $ inherited_array = [ ' string ' ];
}
class Bar extends FooBar
{
private $ inherited_float = 0.22 ;
private $ inherited_bool = 1 == ' 1 ' ;
}
class Foo extends Bar
{
private $ string = ' string ' ;
protected $ int = 10 ;
public $ array = [
' foo ' => ' bar '
];
protected static $ bool = false ;
}
$ string = ' Foobar ' ;
$ array = [ ' foo ' , ' bar ' ];
$ int = 327626 ;
$ double = 22.223 ;
$ null = null ;
$ bool = true ;
$ resource = fopen ( ' LICENSE ' , ' r ' );
$ m = microtime ( true );
new Dump ( new Foo , $ string , $ array , $ int , $ double , $ null , $ bool , [
' foo ' => ' bar ' ,
' bar ' => ' foo ' ,
[
' foo ' => ' foobar ' ,
' bar_foo ' ,
2 => ' foo ' ,
' foo ' => [
' barbar ' => 55 ,
' foofoo ' => false ,
' foobar ' => null ,
]
]
], $ resource );
new Dump ( 1 == ' 1 ' , 1 === ' 1 ' );
Dump:: safe (... $ args ); # running on terminal without color capabilities .การแทนที่สีที่กำหนดไว้ล่วงหน้า:
# set ($ name , [$ cgi_color , $ cli_color ]);
Dump:: set ( ' boolean ' , [ ' bb02ff ' , ' purple ' ]); โดยค่าเริ่มต้นเมื่อมีการถ่ายโอน Dump ภายในฟังก์ชั่นสายการโทรจะถูกตั้งค่าเป็น new Dump ภายในฟังก์ชั่นแทนการเรียกใช้ฟังก์ชัน ด้วย setTraceOffset คุณสามารถตั้งค่าออฟเซ็ตของแต่ละสายการโทร
function dump ()
{
Dump:: setTraceOffset ( 2 );
new Dump (... func_get_args ()); # Dont use this test. php ( line : 4 ) as call line
}
dump ( ' foo ' , 22 , ' bar ' , true ); // Use test.php(line:7) insteadเอาต์พุต CGI:

CLI (UNIX):

CLI (หน้าต่าง):
