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 (7)   DownloadInstall with Composer Download .zip   Reputation   Support forum (2)   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2017-07-11 (3 months ago) RSS 2.0 feedStarStarStar 42%Total: 366 All time: 6,577 This week: 642Up
Version License PHP version Categories
pretty_data_dump 1.0.2BSD License5.3PHP 5, Debug, Console
Description Author

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
  Performance   Level  
Name: chrys ugwu <contact>
Classes: 3 packages by
Country: Nigeria Nigeria
Age: 24
All time rank: 283214 in Nigeria Nigeria
Week rank: 92 Up3 in Nigeria Nigeria Up
Innovation award
Innovation award
Nominee: 2x


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.

Dump implementation in 5.3 is a bit different from 7.0. All new functionality and fixes are implemented on 7.1 though some might be extended to 5.3.


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

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


new Dump7(...); # For PHP 7+
new Dump5(...); # For PHP 5+

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

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

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

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

Replacing predefined colors:

Dump5::set('bool', 'F00');
new Dump5(false, true);

CGI output:

cgi screenshot

CLI output:

cli screenshot

  Files folder image Files  
File Role Description
Files folder imagesrc (2 directories)
Image file cgi.png Data Auxiliary data
Image file cli.png Data Auxiliary data
Plain text file composer.json Data Auxiliary data
Plain text file LICENSE Lic. License text
Plain text file Doc. Documentation

  Files folder image Files  /  src  
File Role Description
Files folder imagePHP5 (1 file)
Files folder imagePHP7 (1 file)

  Files folder image Files  /  src  /  PHP5  
File Role Description
  Plain text file Dump.php Class Class source

  Files folder image Files  /  src  /  PHP7  
File Role Description
  Plain text file Dump.php Class Class source

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