PHPackages                             w3spi5/php-ref-dd - 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. w3spi5/php-ref-dd

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

w3spi5/php-ref-dd
=================

A nicer print\_r/var\_dump alternative for PHP 8.0+ using dd() like in Laravel

1.4(2y ago)048MITPHPPHP &gt;=8.0

Since Jan 31Pushed 2y agoCompare

[ Source](https://github.com/w3spi5/php-ref-dd)[ Packagist](https://packagist.org/packages/w3spi5/php-ref-dd)[ Docs](https://github.com/w3spi5/php-ref-dd)[ RSS](/packages/w3spi5-php-ref-dd/feed)WikiDiscussions main Synced 1mo ago

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

Fork
----

[](#fork)

This is a fork of digitalnature/php-ref with updates from [Juan Manuel Cabello](https://github.com/fellowgeek/php-ref) to include PHP8 adaptations, modified to use `dd()` like in Laravel Framework.

> REF, or `dd()` is a nicer alternative to PHP's [`print_r`](http://php.net/manual/en/function.print-r.php) / [`var_dump`](http://php.net/manual/en/function.var-dump.php) / or `r()` itself functions

Demo
----

[](#demo)

[DEMO from `digitalnature/php-ref`](http://dev.digitalnature.eu/php-ref/)

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

[](#installation)

Start by [installing composer](https://getcomposer.org/doc/01-basic-usage.md#installation). Next do:

```
$ composer require w3spi5/php-ref-dd

```

Requirements
------------

[](#requirements)

PHP 8.x+

Now tell composer to download the bundle by running:

Composer will install the bundle to the directory `vendor/w3spi5`.

Usage
-----

[](#usage)

Basic example:

```
// include the class (not needed if project runs with Composer because it's auto-loaded)
require '/full/path/to/ref.php';

// display info about defined classes
dd(get_declared_classes());

// display info about global variables
dd($GLOBALS);

```

To print in text mode you can use the `ddt()` function instead:

```
ddt($var);

```

To terminate the script after the info is dumped, prepend the bitwise NOT operator:

```
~dd($var);   // html
~ddt($var);  // text

```

Prepending the error control operator (@) will return the information:

```
$output = @dd($var);   // html
$output = @ddt($var);  // text

```

Keyboard shortcuts (javascript must be enabled):

- `X` - collapses / expands all levels

To modify the global configuration call `ref::config()`:

```
// example: initially expand first 3 levels
ref::config('expLvl', 3);

```

Currently available options and their default values:

OptionDefaultDescription`'expLvl'``1`Initially expanded levels (for HTML mode only). A negative value will expand all levels`'maxDepth'``6`Maximum depth (`0` to disable); note that disabling it or setting a high value can produce a 100+ MB page when input involves large data`'showIteratorContents'``FALSE`Display iterator data (keys and values)`'showResourceInfo'``TRUE`Display additional information about resources`'showMethods'``TRUE`Display methods and parameter information on objects`'showPrivateMembers'``FALSE`Include private properties and methods`'showStringMatches'``TRUE`Perform and display string matches for dates, files, json strings, serialized data, regex patterns etc. (SLOW)`'formatters'``array()`Custom/external formatters (as associative array: format =&gt; className)`'shortcutFunc'``array('r', 'rt')`Shortcut functions used to detect the input expression. If they are namespaced, the namespace must be present as well (methods are not supported)`'stylePath'``'{:dir}/ref.css'`Local path to a custom stylesheet (HTML only); `FALSE` means that no CSS is included.`'scriptPath'``'{:dir}/ref.js'`Local path to a custom javascript (HTML only); `FALSE` means no javascript (tooltips / toggle / kbd shortcuts require JS)`'showUrls'``TRUE`Gets information about URLs. Setting to false can improve performance (requires showStringMatches to be TRUE)License
-------

[](#license)

This library is released under the MIT license. See the complete license in the LICENSE file.

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

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

838d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e4ff8a61fb93cab60f87112af5f040144ec19a28574935f83c9ae999bab4a3d5?d=identicon)[w3spi5](/maintainers/w3spi5)

---

Top Contributors

[![fellowgeek](https://avatars.githubusercontent.com/u/3333580?v=4)](https://github.com/fellowgeek "fellowgeek (10 commits)")[![w3spi5](https://avatars.githubusercontent.com/u/8407711?v=4)](https://github.com/w3spi5 "w3spi5 (1 commits)")

---

Tags

debugvar\_dumpdd

### Embed Badge

![Health badge](/badges/w3spi5-php-ref-dd/health.svg)

```
[![Health](https://phpackages.com/badges/w3spi5-php-ref-dd/health.svg)](https://phpackages.com/packages/w3spi5-php-ref-dd)
```

###  Alternatives

[digitalnature/php-ref

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

351696.0k13](/packages/digitalnature-php-ref)[koriym/printo

An object graph visualizer.

1421.8M2](/packages/koriym-printo)[mmucklo/krumo

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

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

PHPackages © 2026

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