Skip to content

A styled way of doing var_dump inspired by the Symfony VarDumper package, this is a simple 1 file import into any PHP project.

Notifications You must be signed in to change notification settings

tomo54321/PHP-Dump

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

PHP Dump

A lightweight script to provide an easy to read var_dump. Includes a class and two functions which provide a styled version of var_dump. This is heavily influenced by the Symfony VarDumper(https://symfony.com/doc/current/components/var_dumper.html).

Functions

If the two below functions already exist in your project then they will not be overwritten, see the class below to create your own function.

dump(...$vars)

Provides the dump inline with other content, this command also adds styles to style it all up. You can provide more than one variable to dump in the functions arguments.

dd(...$vars)

The dump and die function does the same as the dump function except it clears the existing output and only displays the dump.

Class

The only class is in the Tomo namespace and is DebugDump. You can create your own function or use the class to render the dump using the example below:

<?php
$var1 = [
  "Hello" => "World"
];
$var2 = "Hello world!";

(new \Tomo\DebugDump($var1, $var2))->render();

About

A styled way of doing var_dump inspired by the Symfony VarDumper package, this is a simple 1 file import into any PHP project.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages