PHP Classes

Prettify PHP var_dump: Output variable values in a colorized way

Recommend this page to a friend!
  Info   View files Documentation   View files View files (6)   DownloadInstall with Composer Download .zip   Reputation   Support forum (2)   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStar 49%Total: 417 All time: 6,422 This week: 571Up
Version License PHP version Categories
pretty_data_dump 1.0.4BSD License5.3PHP 5, Debug, Console


This class can output variable values in a colorized way.

It can take a variable value and output HTML to displays it like the PHP var_dump function but highlights with colors different types of value.

For objects and arrays it traverses the contained elements recursively.

The class can also output variable values to a console as text without colors.

Innovation Award
PHP Programming Innovation award nominee
July 2017
Number 2
PHP provides nice functions to dump the type and values of a variables like var_dump and var_export.

This package provides an enhanced version of the var_dump function by colorizing the different values according their types.

Manuel Lemos
Picture of chrys ugwu
  Performance   Level  
Name: chrys ugwu <contact>
Classes: 16 packages by
Country: Nigeria Nigeria
Age: 31
All time rank: 16817 in Nigeria Nigeria
Week rank: 74 Up5 in Nigeria Nigeria Up
Innovation award
Innovation award
Nominee: 4x


Pretty Data Dump

A pretty version of php var_dump. This class displays structured information about one or more expressions that includes its type and value.

_Check out Dump7 for PHP 7+_


You can download the Latest release version as a standalone, alternatively you can use Composer

$ composer require ghostff/dump5
"require": {
    "ghostff/dump5": "^1.0"

class Foo
    private $string = 'string';
    protected $int = 10;
    public $array = array(
        'foo'   => 'bar'
    protected static $bool = false;

$string = 'Foobar';
$array = array('foo', 'bar');
$int = 327626;
$double = 22.223;
$null = null;
$bool = true;

new Dump(new Foo, $string, $array, $int, $double, $null, $bool, array(
    'foo' => 'bar',
    'bar' => 'foo',
        'foo' => 'foobar',
        2 => 'foo',
        'foo' => array(
            'barbar' => 55,
            'foofoo' => false,
            'foobar' => null,

new Dump(1 == '1', 1 === '1');

Replacing predefined colors:

# set($name, [$cgi_color, $cli_color]);
Dump::set('boolean', ['bb02ff', 'purple']);

CGI output:

cgi screenshot

CLI Posix output:

cli screenshot

Windows user who are using command line tools like cmder can use the Dump::d method:

Dump::d(new Foo, $string, $array, $int, $double, $null, $bool, array(
    'foo' => 'bar',
    'bar' => 'foo',
        'foo' => 'foobar',
        2 => 'foo',
        'foo' => array(
            'barbar' => 55,
            'foofoo' => false,
            'foobar' => null,

CLI Windows output:

cli screenshot

  Files folder image Files  
File Role Description
Image file cgi.png Data Auxiliary data
Plain text file composer.json Data Auxiliary data
Plain text file LICENSE Lic. License text
Image file posix.png Data Auxiliary data
Image file posixWin.png Data Auxiliary data
Plain text file Doc. Documentation

 Version Control Unique User Downloads Download Rankings  
This week:0
All time:6,422
This week:571Up
User Ratings User Comments (1)
 All time
I have tested the standalone version (Dump5-1.
6 years ago (Alekos Psimikakis)