PHP code example of yiisoft / var-dumper

1. Go to this page and download the library: Download yiisoft/var-dumper library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

yiisoft / var-dumper example snippets


\Yiisoft\VarDumper\VarDumper::dump($variable);

// Prints variables:
d($variable, /* Further variables to dump. */);
// The same as above
dump($variable, /* Further variables to dump. */);

// Prints variables and terminate the current script:
dd($variable, /* Further variables to dump. */);

$string = \Yiisoft\VarDumper\VarDumper::create($variable)->asString(10, true);

$string = \Yiisoft\VarDumper\VarDumper::create($variable)->export();

$string = \Yiisoft\VarDumper\VarDumper::create($variable)->asJson();