PHPackages                             qafoo/ser-pretty - 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. qafoo/ser-pretty

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

qafoo/ser-pretty
================

Pretty print serialized PHP data

40205.3k↑15.8%3[1 issues](https://github.com/Qafoo/ser-pretty/issues)PHP

Since Sep 30Pushed 3y ago6 watchersCompare

[ Source](https://github.com/Qafoo/ser-pretty)[ Packagist](https://packagist.org/packages/qafoo/ser-pretty)[ RSS](/packages/qafoo-ser-pretty/feed)WikiDiscussions master Synced 3d ago

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

ser-pretty
==========

[](#ser-pretty)

[![Build Status](https://camo.githubusercontent.com/2848e2415f3cc085422abdb64df3ddee8d30a490b645e81519fa5c213b703c1f/68747470733a2f2f7472617669732d63692e6f72672f5161666f6f2f7365722d7072657474792e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/Qafoo/ser-pretty)

**ser-pretty prints serialized PHP in the style of `var_dump()` without sourcing the required classes.**

```
$ src/bin/ser-pretty test.txt
  class stdClass (1) {
    private $bar =>
    int(223)
  }

```

[Download ser-pretty as a PHAR](https://github.com/Qafoo/ser-pretty/releases)or require `qafoo/ser-pretty` via composer.

But, why?
---------

[](#but-why)

It happens often that you have serialized PHP data lying around, e.g. from caching, session data or transmitting it through a queue. If you want to inspect this data for debugging purposes you typically write a tiny script that loads your classes (which are needed for de-serialization), get the data and display a var dump.

ser-pretty deprecates the script-step by simply rendering a `var_dump()` outut from serialized data, without needing to source the class source.

The CLI
-------

[](#the-cli)

ser-pretty comes with a very simple PHP CLI script, that reads serialized data from STDIN or a given file and prints the formatted output to STDOUT. Just call:

```
$ ser-pretty.phar dumped_data.txt

```

This even works for [Doctrine](http://docs.doctrine-project.org/) annotation cache files since ser-pretty 0.2.0.

You can also pipe serialized data from another script to it:

```
$ some_script.php | ser-pretty.phar

```

The Lib
-------

[](#the-lib)

You can also use ser-pretty as a library to integrate pretty printing of serialized PHP data into your debugging/monitoring/… tools. Just look into the CLI script to see what it does.

- The `Parser` parses serialized into a very simple AST
- A `Writer` turns an AST into a string representation

ser-pretty ships with a `var_dump()` style writer, the `SimpleTextWriter` which you can use out of the box. You can implement your own writer by deriving the `Writer` class.

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

[](#installation)

Just include ser-pretty in your project via composer using or [download the latest PHAR](https://github.com/Qafoo/ser-pretty/releases).

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity45

Moderate usage in the ecosystem

Community17

Small or concentrated contributor base

Maturity25

Early-stage or recently created project

 Bus Factor1

Top contributor holds 87.3% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/5b4beabbad777c5b6522018525666cc9ce96d3abcd9e702fccacde178951737c?d=identicon)[kore](/maintainers/kore)

![](https://avatars.githubusercontent.com/u/187140?v=4)[Tobias Schlitt](/maintainers/tobyS)[@tobyS](https://github.com/tobyS)

---

Top Contributors

[![tobyS](https://avatars.githubusercontent.com/u/187140?v=4)](https://github.com/tobyS "tobyS (48 commits)")[![Seldaek](https://avatars.githubusercontent.com/u/183678?v=4)](https://github.com/Seldaek "Seldaek (4 commits)")[![kristsk](https://avatars.githubusercontent.com/u/310808?v=4)](https://github.com/kristsk "kristsk (2 commits)")[![andreaswolf](https://avatars.githubusercontent.com/u/159919?v=4)](https://github.com/andreaswolf "andreaswolf (1 commits)")

### Embed Badge

![Health badge](/badges/qafoo-ser-pretty/health.svg)

```
[![Health](https://phpackages.com/badges/qafoo-ser-pretty/health.svg)](https://phpackages.com/packages/qafoo-ser-pretty)
```

###  Alternatives

[solaris/php-moon-phase

Calculate the phases of the Moon in PHP.

16671.1k1](/packages/solaris-php-moon-phase)[phpinnacle/buffer

PHPinnacle binary buffer implementation

2498.3k11](/packages/phpinnacle-buffer)[yii2mod/yii2-chosen-select

Chosen Select Widget based on Chosen jQuery plugin

14117.6k](/packages/yii2mod-yii2-chosen-select)

PHPackages © 2026

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