Dump7
v2.0.2
PHP var_dumpのきれいなバージョン。このクラスは、その種類と価値を含む1つ以上の式に関する構造化された情報を表示します。
PHP 5+のDump5をご覧ください
最新リリースバージョンをスタンドアロンとしてダウンロードできます。また、作曲家を使用できます。
composer require ghostff/dump7 "require" : {
"ghostff/dump7" : " ^1.0 "
}Doc Blockフラグを使用して、いくつかのオブジェクト属性を単純に非表示または表示できます。
@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) insteadCGI出力:

CLI(UNIX):

CLI(ウィンドウ):
