PHP code example of mmantai / var_dumper

1. Go to this page and download the library: Download mmantai/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/ */

    

mmantai / var_dumper example snippets


use Mmantai\VarDumper\VarDumper;

class Calc
{

    public function __construct(public int|float $a, public int|float $b)
    {

    }
    
    public function add()
    {
        return $this->a + $this->b;
    }
}

$calc = new Calc(5, 10);

VarDumper::dump($calc);

use Mmantai\VarDumper\VarDumper;

$arr = [
    "This",
    "is",
    "an",
    "array",
    5,
    10.0
];

VarDumper::dump($arr);