Dump5
v2.0.1
PHP var_dump의 예쁜 버전. 이 클래스는 유형 및 값을 포함하는 하나 이상의 표현식에 대한 구조화 된 정보를 표시합니다.
PHP 7+의 경우 덤프 7을 확인하십시오
최신 릴리스 버전을 독립형으로 다운로드 할 수 있습니다. 또는 Composer를 사용할 수 있습니다.
composer require ghostff/dump5 "require" : {
"ghostff/dump5" : " ^1.0 "
}Doc 블록 플래그를 사용하여 간단한 숨기거나 일부 객체 속성을 표시 할 수 있습니다.
@dumpignore-inheritance | 상속 된 클래스 속성을 숨 깁니다. |
@dumpignore-inherited-class | 상속 된 속성에서 클래스 이름을 숨 깁니다. |
@dumpignore-private | 개인 속성을 제외한 모든 속성을 표시하십시오. |
@dumpignore-protected | 보호 된 속성을 제외한 모든 속성을 보여줍니다. |
@dumpignore-public | 공개 속성을 제외한 모든 속성을 보여줍니다. |
@dumpignore | DOC 주석이 속한 속성을 숨 깁니다. |
/**
* @dumpignore-inheritance
* @dumpignore-inherited-class
* @dumpignore-private
* @dumpignore-public
* @dumpignore-public
*/
Class Foo extends Bar {
/** @dumpignore */
public $ big_object = null ;
} class FooBar
{
private $ inherited_int = 123 ;
private $ inherited_array = array ( ' string ' );
}
class Bar extends FooBar
{
private $ inherited_float = 0.22 ;
private $ inherited_bool = true ;
}
class Foo extends Bar
{
private $ string = ' string ' ;
protected $ int = 10 ;
public $ array = array (
' foo ' => ' bar '
);
protected static $ bool = false ;
}
$ string = ' Foobar ' ;
$ array = 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 , array (
' foo ' => ' bar ' ,
' bar ' => ' foo ' ,
array (
' foo ' => ' foobar ' ,
' bar_foo ' ,
2 => ' foo ' ,
' foo ' => array (
' barbar ' => 55 ,
' foofoo ' => false ,
' foobar ' => null ,
)
)
), $ resource );
new Dump ( 1 == ' 1 ' , 1 === ' 1 ' );사전 정의 된 색상 교체 :
# set ( $ name , [ $cgi_color , $cli_color ] ) ;
Dump:: set ( ' boolean ' , array ( ' bb02ff ' , ' purple ' ));CGI 출력 :

CLI POSIX 출력 :

cmder 와 같은 명령 줄 도구를 사용하는 Windows 사용자는 Dump::d 메소드를 사용할 수 있습니다.
Dump:: d ( new Foo , $ string , $ array , $ int , $ double , $ null , $ bool , array (
' foo ' => ' bar ' ,
' bar ' => ' foo ' ,
array (
' foo ' => ' foobar ' ,
' bar_foo ' ,
2 => ' foo ' ,
' foo ' => array (
' barbar ' => 55 ,
' foofoo ' => false ,
' foobar ' => null ,
)
)
));CLI Windows 출력 :
