PHP code example of max / var-dumper

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

    

max / var-dumper example snippets




declare(strict_types=1);

return [
    'handler' => [
        'http' => [
            Next\VarDumper\Adapter\HyperfDumperHandler::class,
            Hyperf\HttpServer\Exception\Handler\HttpExceptionHandler::class,
            App\Exception\Handler\AppExceptionHandler::class,
        ],
    ],
];




namespace App;

use Next\VarDumper\Dumper;
use Next\VarDumper\DumperHandler;
use support\exception\Handler;
use Throwable;
use Webman\Http\Request;
use Webman\Http\Response;

class ExceptionHandler extends Handler
{
    use DumperHandler;

    public function render(Request $request, Throwable $exception): Response
    {
        if ($exception instanceof Dumper) {
            return \response(self::convertToHtml($exception));
        }
        return parent::render($request, $exception);
    }
}


return [
    '' => \App\ExceptionHandler::class,
];

d($request);