PHPackages                             alexxxnf/nf\_pp - 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. alexxxnf/nf\_pp

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

alexxxnf/nf\_pp
===============

Pretty "print\_r" with some additional features

v2.2.0(11y ago)144.7k↓31.3%8MITPHPPHP &gt;=5.2.0

Since Feb 26Pushed 11y ago3 watchersCompare

[ Source](https://github.com/alexxxnf/nf_pp)[ Packagist](https://packagist.org/packages/alexxxnf/nf_pp)[ Docs](https://github.com/alexxxnf/nf_pp/)[ RSS](/packages/alexxxnf-nf-pp/feed)WikiDiscussions master Synced 1mo ago

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

nf\_pp
======

[](#nf_pp)

`nf_pp` is a class designed to emulate PHP function "print\_r" with some additional features.

[![illustration](https://camo.githubusercontent.com/dc1fff08891369b2116bb7ed074fbdc6b5050741fa4bd9211f6c88b7bc82482a/687474703a2f2f626c6f672e616c657878786e662e72752f696d672f61727469636c652f7072696e745f722f636f6d706172652e706e67)](https://camo.githubusercontent.com/dc1fff08891369b2116bb7ed074fbdc6b5050741fa4bd9211f6c88b7bc82482a/687474703a2f2f626c6f672e616c657878786e662e72752f696d672f61727469636c652f7072696e745f722f636f6d706172652e706e67)

Features
--------

[](#features)

- print scalar variables, arrays, object, resources;
- highlight data types;
- highlight properties scope;
- visualize values of the boolean and NULL variables;
- show resource type;
- trim long strings;
- print tree-like view for arrays and objects;
- fold nodes in arrays and objects;
- fold whole tree or unfold tree to a certain key;
- display file and line where the function was called;
- print elapsed time between function calls;
- search in keys and values (hit ENTER or Shift+ENTER in search field to navigate).

Usage
-----

[](#usage)

Include `nf_pp.php` file, create an object and pass options to it.

```
include 'nf_pp.php';
$pp = new nf_pp( array( 'trimString' => 0 ) );

```

And use it.

```
$pp->pp( $val1 );
$pp->pp( $val2 );

```

If you don't like to create an object, you can use a shortcut function.

```
pp( $val, array( 'trimString' => 0 ) );

```

### Options

[](#options)

`trimString` — Default value is 1000 simbols. 0 — disable trimming. `autoCollapsed` — Fold tree. Default value is `FALSE`. `autoOpen` — Array of keys or a single key which will be used to unfold the tree.

You can pass options to the function as an array or one by one in any order. For example:

```
pp( $val, 300, 'key' );

```

or

```
pp( $val, 'key', 0 );

```

or

```
pp( $val, 'key' );

```

Options are determined by types. If number is passed, then it is `trimString` option. If boolean is passed, then it is `autoCollapsed` option. If string is passed, then it is `autoOpen` option.

### Examples

[](#examples)

See `demo.php`. Online demo can be found here [http://demo.alexxxnf.ru/print\_r/](http://demo.alexxxnf.ru/print_r/).

Print an array. [Demo](http://demo.alexxxnf.ru/print_r/)

```
pp( $val );

```

Print folded array. [Demo](http://demo.alexxxnf.ru/print_r/#autoCollapsed)

```
pp( $val, TRUE );

```

Print folded array and unfold it to keys "c" and "subarray". [Demo](http://demo.alexxxnf.ru/print_r/#autoOpened)

```
pp( $val, array( 'autoOpen' => array( 'c', 'subarray' ) ) );

```

Print folded array and unfold it to key "c". [Demo](http://demo.alexxxnf.ru/print_r/#autoOpened2)

```
pp( $val, array( 'autoOpen' => array( 'c' ) ) );

```

or

```
pp( $val, 'c' );

```

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity33

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity59

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

Total

2

Last Release

4062d ago

### Community

Maintainers

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

---

Top Contributors

[![alexxxnf](https://avatars.githubusercontent.com/u/1462908?v=4)](https://github.com/alexxxnf "alexxxnf (9 commits)")

---

Tags

arraydebugdumpobjectprintprint\_rvar\_dump

### Embed Badge

![Health badge](/badges/alexxxnf-nf-pp/health.svg)

```
[![Health](https://phpackages.com/badges/alexxxnf-nf-pp/health.svg)](https://phpackages.com/packages/alexxxnf-nf-pp)
```

###  Alternatives

[symfony/property-access

Provides functions to read and write from/to an object or array using a simple string notation

2.8k295.3M2.5k](/packages/symfony-property-access)[cuyz/valinor

Dependency free PHP library that helps to map any input into a strongly-typed structure.

1.5k9.2M108](/packages/cuyz-valinor)[leeoniya/dump-r

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

12368.1k5](/packages/leeoniya-dump-r)[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)[mmucklo/krumo

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

89168.0k6](/packages/mmucklo-krumo)[jasny/dotkey

Dot notation access for objects and arrays

14219.5k6](/packages/jasny-dotkey)

PHPackages © 2026

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