PHPackages                             horizom/var-dumper - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Debugging &amp; Profiling](/categories/debugging)
4. /
5. horizom/var-dumper

ActiveLibrary[Debugging &amp; Profiling](/categories/debugging)

horizom/var-dumper
==================

A nicer print\_r/var\_dump alternative

3.1.4(1y ago)82761[3 issues](https://github.com/horizom/var-dumper/issues)MITPHPPHP &gt;=7.0

Since Aug 15Pushed 1y ago1 watchersCompare

[ Source](https://github.com/horizom/var-dumper)[ Packagist](https://packagist.org/packages/horizom/var-dumper)[ Docs](https://horizom.github.io)[ RSS](/packages/horizom-var-dumper/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (5)DependenciesVersions (6)Used By (0)

[![Total Downloads](https://camo.githubusercontent.com/3bb0e345bc25dc8bbf30625261182dc89ceb073698abea8c57bd4ccc1c1c9bdd/68747470733a2f2f706f7365722e707567782e6f72672f686f72697a6f6d2f7661722d64756d7065722f642f746f74616c2e737667)](https://packagist.org/packages/horizom/var-dumper)[![Latest Stable Version](https://camo.githubusercontent.com/1f59b084f1955619da8019bdfb68207dbf3ed633a317ea81a3227978eab8756b/68747470733a2f2f706f7365722e707567782e6f72672f686f72697a6f6d2f7661722d64756d7065722f762f737461626c652e737667)](https://packagist.org/packages/horizom/var-dumper)[![License](https://camo.githubusercontent.com/7b09fe00ae0ca7c3149c056e9e881b07dce53d0030ccaf2ff60d714543533a75/68747470733a2f2f706f7365722e707567782e6f72672f686f72697a6f6d2f7661722d64756d7065722f6c6963656e73652e737667)](https://packagist.org/packages/horizom/var-dumper)

VarDumper, or `dump()` is a nicer alternative to PHP's [`print_r`](http://php.net/manual/en/function.print-r.php) / [`var_dump`](http://php.net/manual/en/function.var-dump.php) functions.

This project is a fork of the original project by [digitalnature](https://github.com/digitalnature/php-ref). A big thank you to him for the work he has done on his project.

DEMO
----

[](#demo)

[![](var-dumper.jpg)](var-dumper.jpg)

Or You can see full demo at [Full demo](var-dumper-full-demo.jpg)

Installation using Composer
---------------------------

[](#installation-using-composer)

Add VarDumper to your `composer.json`:

```
{
    "require": {
        "horizom/var-dumper": "^3.1"
    }
}
```

Now tell composer to download the bundle by running:

```
composer require horizom/var-dumper
```

Composer will install the bundle to the directory `vendor/horizom`.

Usage
-----

[](#usage)

Basic example:

```
// include the class (not needed if project runs with Composer because it's auto-loaded)
require 'vendor/autoload.php';

// display info about defined classes
dump(get_declared_classes());

// display info about global variables
dump($GLOBALS);
```

To print in text mode you can use the `dump_text()` function instead:

```
dump_text($var);
```

To terminate the script after the info is dumped, prepend the bitwise NOT operator:

```
~dump($var);   // html
~dump_text($var);  // text
```

Prepending the error control operator (@) will return the information:

```
$output = @dump($var);   // html
$output = @dump_text($var);  // text
```

Keyboard shortcuts (javascript must be enabled):

- `X` - collapses / expands all levels
- `Ctrl` + `X` - toggles display state

To modify the global configuration call `\Horizom\VarDumper\VarDumper::config()`:

```
// example: initially expand first 3 levels
\Horizom\VarDumper\VarDumper::config('expLvl', 3);
```

You can also add configuration options in your `php.ini` file like this:

```
[varDumper]
varDumper.expLvl = 3
varDumper.maxDepth = 4
```

Currently available options and their default values:

OptionDefaultDescription`'expLvl'``1`Initially expanded levels (for HTML mode only). A negative value will expand all levels`'maxDepth'``6`Maximum depth (`0` to disable); note that disabling it or setting a high value can produce a 100+ MB page when input involves large data`'showIteratorContents'``FALSE`Display iterator data (keys and values)`'showResourceInfo'``TRUE`Display additional information about resources`'showMethods'``TRUE`Display methods and parameter information on objects`'showPrivateMembers'``FALSE`Include private properties and methods`'showStringMatches'``TRUE`Perform and display string matches for dates, files, json strings, serialized data, regex patterns etc. (SLOW)`'formatters'``array()`Custom/external formatters (as associative array: format =&gt; className)`'shortcutFunc'``array('dump', 'dump_text')`Shortcut functions used to detect the input expression. If they are namespaced, the namespace must be present as well (methods are not supported)`'stylePath'``'{:dir}/assets/dumper.css'`Local path to a custom stylesheet (HTML only); `FALSE` means that no CSS is included.`'scriptPath'``'{:dir}/assets/dumper.js'`Local path to a custom javascript (HTML only); `FALSE` means no javascript (tooltips / toggle / kbd shortcuts require JS)`'showUrls'``FALSE`Gets information about URLs. Setting to false can improve performance (requires showStringMatches to be TRUE)`'timeout'``10`Stop execution after this amount of seconds, forcing an incomplete listing. Applies to all calls`'validHtml'``FALSE`For HTML mode only. Whether to produce W3C-valid HTML (larger code output) or unintelligible, potentially browser-incompatible but much smaller code outputTODOs
-----

[](#todos)

- Inherit DocBlock comments from parent or prototype, if missing
- Refactor "bubbles" (for text-mode)
- Correctly indent multi-line strings (text-mode)
- Move separator tokens to ::before and ::after pseudo-elements (html-mode)

Changelog
---------

[](#changelog)

All notable changes to this project will be documented in the file [CHANGELOG](CHANGELOG.md).

License
-------

[](#license)

The Horizom framework is open-sourced software licensed under the [MIT license](LICENSE.md).

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance25

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~167 days

Total

5

Last Release

696d ago

PHP version history (2 changes)3.1.0PHP ^7.0

3.1.1PHP &gt;=7.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/412f8e786e65f078584b4bc2c0b7a44af095ab2c0d19a5fb7985598576ca4fda?d=identicon)[lambirou](/maintainers/lambirou)

---

Top Contributors

[![lambirou](https://avatars.githubusercontent.com/u/1428556?v=4)](https://github.com/lambirou "lambirou (7 commits)")

---

Tags

debugphpdebugprint\_rvar\_dump

### Embed Badge

![Health badge](/badges/horizom-var-dumper/health.svg)

```
[![Health](https://phpackages.com/badges/horizom-var-dumper/health.svg)](https://phpackages.com/packages/horizom-var-dumper)
```

###  Alternatives

[digitalnature/php-ref

A nicer print\_r/var\_dump alternative for PHP 5.3+

351696.0k12](/packages/digitalnature-php-ref)[mmucklo/krumo

KRUMO - version 2.0 of print\_r(); and var\_dump(); (with new updates)

89168.0k6](/packages/mmucklo-krumo)[leeoniya/dump-r

a cleaner, leaner mix of print\_r() and var\_dump()

12368.1k5](/packages/leeoniya-dump-r)[koriym/printo

An object graph visualizer.

1421.8M2](/packages/koriym-printo)[jbzoo/jbdump

Script for debug and dump PHP variables and other stuff. This tool is a nice replacement for print\_r() and var\_dump() functions.

211.1M3](/packages/jbzoo-jbdump)[kktsvetkov/krumo

Krumo is a debugging tool, which displays structured information about any PHP variable. It is a nice replacement for print\_r() or var\_dump() which are used by a lot of PHP developers.

8260.7k](/packages/kktsvetkov-krumo)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
