PHPackages                             mnapoli/number-two - 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. mnapoli/number-two

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

mnapoli/number-two
==================

NumberTwo is a classy variable dumper

1.0.0(12y ago)74651MITPHP

Since Jul 16Pushed 11y ago1 watchersCompare

[ Source](https://github.com/mnapoli/NumberTwo)[ Packagist](https://packagist.org/packages/mnapoli/number-two)[ Docs](https://github.com/mnapoli/NumberTwo)[ RSS](/packages/mnapoli-number-two/feed)WikiDiscussions master Synced 3w ago

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

NumberTwo
=========

[](#numbertwo)

NumberTwo is a classy variable dumper.

[![Build Status](https://camo.githubusercontent.com/effdb49c477f4696b712ebe760afc5459039a70bfce70562063b3416c6ad3b98/68747470733a2f2f7472617669732d63692e6f72672f6d6e61706f6c692f4e756d62657254776f2e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/mnapoli/NumberTwo)

When `var_dump` or `print_r` is too verbose or unpleasant to read, go for NumberTwo.

### Scalars

[](#scalars)

```
echo NumberTwo::dump(null);
// null

echo NumberTwo::dump(true);
// true
echo NumberTwo::dump(false);
// false

echo NumberTwo::dump(1);
// 1

echo NumberTwo::dump('foo');
// "foo"
```

### Arrays

[](#arrays)

```
echo NumberTwo::dump(array('foo', 'bar'));
```

```
[
    0 => "foo"
    1 => "bar"
]
```

```
echo NumberTwo::dump(array('foo' => 'bar'));
```

```
[
    "foo" => "bar"
]
```

### Objects

[](#objects)

```
echo NumberTwo::dump($object);
```

```
My\ClassWithPublicProperties {
    foo: "aaa"
    bar: "bbb"
}
```

You can configure the recursive depth:

```
echo NumberTwo::dump($otherObject, 2);
```

```
UnitTest\NumberTwo\PublicProperties {
    foo: UnitTest\NumberTwo\PublicProperties {
        foo: UnitTest\NumberTwo\PrivateProperties { ... }
        bar: null
    }
    bar: null
}
```

### Filters

[](#filters)

You may want to pre-process some objects that are to be dumped.

For that, you can use the filters:

```
$filters = array(new MyFilter());

echo NumberTwo::dump($otherObject, 2, $filters);
```

#### Doctrine Collection

[](#doctrine-collection)

NumberTwo provides a filter for Doctrine's collections:

```
use NumberTwo\Filter\DoctrineCollectionFilter;

$filters = array(new DoctrineCollectionFilter());

echo NumberTwo::dump($otherObject, 2, $filters);
```

This filter will turn any Collection (ArrayCollection, PersistentCollection, …) into a PHP array (using the `toArray()` method).

#### Doctrine proxies

[](#doctrine-proxies)

NumberTwo provides a filter for Doctrine's proxies:

```
use NumberTwo\Filter\DoctrineProxyFilter;

$filters = array(new DoctrineProxyFilter());

echo NumberTwo::dump($otherObject, 2, $filters);
```

This filter will load uninitialized proxies and clean up properties.

Feel free to submit other filters in a pull request.

License
-------

[](#license)

NumberTwo is under the MIT license.

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity67

Established project with proven stability

 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 ~2 days

Total

5

Last Release

4723d ago

Major Versions

0.2.1 → 1.0.02013-07-25

### Community

Maintainers

![](https://www.gravatar.com/avatar/329a6111724074f5388e95dd41a03ccf3c43f4bfe1ecf27c94c9efc6f7823228?d=identicon)[mnapoli](/maintainers/mnapoli)

---

Top Contributors

[![mnapoli](https://avatars.githubusercontent.com/u/720328?v=4)](https://github.com/mnapoli "mnapoli (32 commits)")

---

Tags

debugdumpvar\_dumpvariable

### Embed Badge

![Health badge](/badges/mnapoli-number-two/health.svg)

```
[![Health](https://phpackages.com/badges/mnapoli-number-two/health.svg)](https://phpackages.com/packages/mnapoli-number-two)
```

###  Alternatives

[symfony/var-dumper

Provides mechanisms for walking through any arbitrary PHP variable

7.4k887.9M9.2k](/packages/symfony-var-dumper)[kint-php/kint

Kint - Advanced PHP dumper

2.8k20.2M301](/packages/kint-php-kint)[digitalnature/php-ref

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

342715.1k13](/packages/digitalnature-php-ref)[leeoniya/dump-r

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

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

An object graph visualizer.

1422.0M2](/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.

191.1M3](/packages/jbzoo-jbdump)

PHPackages © 2026

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