PHPackages                             1tomany/pretty-print - 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. 1tomany/pretty-print

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

1tomany/pretty-print
====================

A simple, no dependency library to format PHP values as strings

v0.0.1(2mo ago)06MITPHPPHP &gt;=8.0

Since Mar 3Pushed 2mo agoCompare

[ Source](https://github.com/1tomany/pretty-print)[ Packagist](https://packagist.org/packages/1tomany/pretty-print)[ RSS](/packages/1tomany-pretty-print/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (3)Versions (2)Used By (0)

Pretty Print for PHP
====================

[](#pretty-print-for-php)

This small library is a handy utility for pretty printing a wide variety of PHP values as strings. It is particularly useful if you wish to safely print unstructured user input; a URL encoded HTTP request for instance.

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

[](#installation)

```
composer require 1tomany/pretty-print

```

Usage
-----

[](#usage)

```
use function OneToMany\PrettyPrint\pretty_print;

var_dump(pretty_print(null)); // string(4) "null"
var_dump(pretty_print(true)); // string(4) "true"
var_dump(pretty_print(false)); // string(5) "false"
var_dump(pretty_print(0)); // string(1) "0"
var_dump(pretty_print(1.0)); // string(3) "1.0"
var_dump(pretty_print(\M_PI)); // string(15) "3.1415926535898"
var_dump(pretty_print('PHP')); // string(5) ""PHP""
var_dump(pretty_print([])); // string(2) "[]"
var_dump(pretty_print(['A', 'B'])); // string(10) "["A", "B"]"
var_dump(pretty_print(['name' => 'Vic'])); // string(15) "[name => "Vic"]"
var_dump(pretty_print(new \DateTimeImmutable())); // string(25) "2026-03-03T17:36:40+00:00"
var_dump(pretty_print('This string is longer than 32 characters', 32)); // string(37) ""This string is longer than 32 ch...""
var_dump(pretty_print(\fopen('file.txt', 'r'))); // string(7) "unknown"
```

Credits
-------

[](#credits)

- [Vic Cherubini](https://github.com/viccherubini), [1:N Labs, LLC](https://1tomany.com)

License
-------

[](#license)

The MIT License

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance85

Actively maintained with recent releases

Popularity5

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity29

Early-stage or recently created project

 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

76d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/60762?v=4)[Vic Cherubini](/maintainers/viccherubini)[@viccherubini](https://github.com/viccherubini)

---

Top Contributors

[![viccherubini](https://avatars.githubusercontent.com/u/60762?v=4)](https://github.com/viccherubini "viccherubini (25 commits)")

---

Tags

print\_rvar\_dumpvardumpvar-dumperVarDumperpretty-printPrintr

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/1tomany-pretty-print/health.svg)

```
[![Health](https://phpackages.com/badges/1tomany-pretty-print/health.svg)](https://phpackages.com/packages/1tomany-pretty-print)
```

###  Alternatives

[mmucklo/krumo

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

89168.0k6](/packages/mmucklo-krumo)[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)[ffi/var-dumper

List of symfony/var-dumper casters with FFI support

2010.7k4](/packages/ffi-var-dumper)[ivoba/stop

nice output for debug functions for PHP 5.3

1041.9k5](/packages/ivoba-stop)

PHPackages © 2026

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