PHPackages                             vovan-ve/array-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. vovan-ve/array-dumper

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

vovan-ve/array-dumper
=====================

Dumper for constant arrays

v1.0.0(7y ago)0511MITPHPPHP ^7.1

Since Oct 21Pushed 7y ago1 watchersCompare

[ Source](https://github.com/Vovan-VE/array-dumper)[ Packagist](https://packagist.org/packages/vovan-ve/array-dumper)[ RSS](/packages/vovan-ve-array-dumper/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (2)Versions (2)Used By (1)

`array-dumper`
==============

[](#array-dumper)

[![Latest Stable Version](https://camo.githubusercontent.com/1e870577896a8821d7d9e1c9807bf93b4358c753386b16ee91bdc3845508d638/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f766f76616e2d76652f61727261792d64756d7065722e737667)](https://packagist.org/packages/vovan-ve/array-dumper)[![Latest Dev Version](https://camo.githubusercontent.com/b0c3c0786060aaa37224d692175a3d7c78deedb89192bf7875a5e3aa6b7e3515/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f767072652f766f76616e2d76652f61727261792d64756d7065722e737667)](https://packagist.org/packages/vovan-ve/array-dumper)[![Build Status](https://camo.githubusercontent.com/5a8f109855a6ec69a806bf65fa89a444a252c4dcbd447d5cf88e7a96dfa75659/68747470733a2f2f7472617669732d63692e6f72672f566f76616e2d56452f61727261792d64756d7065722e737667)](https://travis-ci.org/Vovan-VE/array-dumper)[![License](https://camo.githubusercontent.com/4aea0aca402dbea2cf97f3e49554fe93475c488fabe9aec5017bf54bf8107dfd/68747470733a2f2f706f7365722e707567782e6f72672f766f76616e2d76652f61727261792d64756d7065722f6c6963656e7365)](https://packagist.org/packages/vovan-ve/array-dumper)

Dumps PHP array into pretty printed PHP code. Only constant data can be dumped, t.i. data, which can be used in `const` declaration since PHP 7.

Synopsis
--------

[](#synopsis)

```
use \VovanVE\array_dumper\ArrayDumper;

$dumper = new ArrayDumper();

$data = [
    'foo' => 42,
    'bar' => 'string',
    'list' => [10, 20, 30],
    'hash' => [
        'lorem' => 23,
        'ipsum' => true,
    ],
];

echo $dumper->dump($data);
```

Output:

```
[
    'foo' => 42,
    'bar' => 'string',
    'list' => [10, 20, 30],
    'hash' => [
        'lorem' => 23,
        'ipsum' => true,
    ],
]

```

Description
-----------

[](#description)

Simple array with sequential zero-based integer keys (aka lists) will be dumped in single line, unless the line became too long with indention, or lists nesting level became to deep (both are configurable).

An optional outer indent string can be supplied to `dump()` method. It is used internally for nested arrays. It can be anything you want including comment prefix `// `.

Notice: The library works only with UTF-8 strings. A string which is not valid UTF-8 in source data will encode invalid octets with `\xFF` escape codes. So, output dump always should be valid UTF-8 code.

Installation
------------

[](#installation)

Install through [composer](http://getcomposer.org/):

```
composer require vovan-ve/array-dumper

```

or add to `require` section in your composer.json:

```
"vovan-ve/array-dumper": "~1.0.0"

```

License
-------

[](#license)

This package is under [MIT License](https://opensource.org/licenses/MIT)

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity56

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

Unknown

Total

1

Last Release

2762d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1166581?v=4)[Vladimir](/maintainers/Vovan-VE)[@Vovan-VE](https://github.com/Vovan-VE)

---

Top Contributors

[![Vovan-VE](https://avatars.githubusercontent.com/u/1166581?v=4)](https://github.com/Vovan-VE "Vovan-VE (5 commits)")

---

Tags

array-helperdumperpretty-print

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/vovan-ve-array-dumper/health.svg)

```
[![Health](https://phpackages.com/badges/vovan-ve-array-dumper/health.svg)](https://phpackages.com/packages/vovan-ve-array-dumper)
```

###  Alternatives

[ml/iri

IRI handling for PHP

276.4M6](/packages/ml-iri)[s9e/regexp-builder

Library that generates regular expressions that match a list of strings.

352.1M4](/packages/s9e-regexp-builder)

PHPackages © 2026

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