PHPackages                             aksoyih/better-dump - 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. aksoyih/better-dump

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

aksoyih/better-dump
===================

BetterDump: A professional-grade debugging library for PHP that provides a high-fidelity visual representation of variables, tailored for modern web development environments.

2.2.1(3mo ago)034MITPHPPHP &gt;=8.2

Since Jan 18Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/aksoyih/BetterDump)[ Packagist](https://packagist.org/packages/aksoyih/better-dump)[ RSS](/packages/aksoyih-better-dump/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (1)Versions (22)Used By (0)

BetterDump
==========

[](#betterdump)

A professional-grade debugging library for PHP that provides a high-fidelity visual representation of variables, tailored for modern web development environments.

[![Screenshot](https://camo.githubusercontent.com/1e2db8f44dfc0b6d40eb17ea9861154ed801a795335b09072b4d8c488656bd7a/68747470733a2f2f68616c756b616b736f792e6465762f636f6e74656e742f696d616765732f323032362f30322f62657474657264756d7076322e706e67)](https://camo.githubusercontent.com/1e2db8f44dfc0b6d40eb17ea9861154ed801a795335b09072b4d8c488656bd7a/68747470733a2f2f68616c756b616b736f792e6465762f636f6e74656e742f696d616765732f323032362f30322f62657474657264756d7076322e706e67)

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

[](#installation)

```
composer require aksoyih/better-dump
```

Usage
-----

[](#usage)

```
// Dump and continue execution
bd($variable);

// Dump and die (stop execution)
bdd($variable);

// Labeled dump
bd($user, 'User Object');
```

### Global Error Handling

[](#global-error-handling)

BetterDump can act as your application's global error and exception handler, providing a beautiful "Blue Screen of Death" when your code crashes, even if `display_errors` is off in `php.ini`.

```
use Aksoyih\ErrorHandler;

(new ErrorHandler())->register();

// Now even fatal errors or unhandled exceptions will be rendered by BetterDump
throw new Exception("Oops!");
```

### JSON Output Mode

[](#json-output-mode)

For debugging API responses, you can switch to JSON mode. This will output the dump as a formatted JSON response with `Content-Type: application/json` headers.

```
use Aksoyih\BetterDump;

// Enable JSON mode
BetterDump::outputJson(true);

bd($data);
```

### Laravel Integration

[](#laravel-integration)

BetterDump comes with a zero-config Service Provider for Laravel.

1. **Auto-Discovery:** The package is automatically discovered.
2. **Configuration:** It respects your `config('app.editor')` or `config('ignition.editor')` settings.
3. **Safety:** It automatically disables itself in `production` environments based on `APP_ENV`.

To publish the configuration (Optional):

```
php artisan vendor:publish --provider="Aksoyih\Integrations\Laravel\BetterDumpServiceProvider"
```

### Configuration

[](#configuration)

You can configure the editor to open files in. The default is `phpstorm`.

```
use Aksoyih\BetterDump;

// Supported editors: 'vscode', 'phpstorm'
BetterDump::setEditor('vscode');
```

You can also set a local root directory for editor links. This is useful when your runtime paths are relative or inside a container.

```
use Aksoyih\BetterDump;

BetterDump::setRootDirectory('/path/to/your/project');
```

### Production Safety

[](#production-safety)

BetterDump is disabled by default in production environments (`APP_ENV=production` or `APP_ENV=prod`) to prevent accidental leakage of sensitive data.

To force enable it in production:

```
use Aksoyih\BetterDump;

BetterDump::allowProduction(true);
```

### Keyboard Shortcuts

[](#keyboard-shortcuts)

ShortcutAction`Cmd+K` / `Ctrl+K`Toggle Search`/`Focus Search`Escape`Close Search / Close Stack Trace`Cmd+Click`Open File in IDEFeatures
--------

[](#features)

- **Beautiful UI:** Modern, zero-dependency interface with Light/Dark mode support.
- **Search:** Built-in real-time fuzzy search to filter keys and values.
- **Code Snippet Preview:** Automatically displays the code surrounding an error or dump location with syntax highlighting.
- **Smart Helpers:** `bd()` (Dump &amp; Continue) and `bdd()` (Dump &amp; Die).
- **Stack Trace:** View the full execution history leading to the dump.
- **LLM-Ready Copy:** Copy the dump output as clean JSON with context, perfect for pasting into ChatGPT or Claude.
- **Deep Linking:** Clickable file paths that open directly in your IDE (PhpStorm/VSCode).
- **Image Previews:** Hover over image URLs to see a thumbnail.
- **Recursion Detection:** Safely handles circular references.
- **Performance Metrics:** Shows execution time and memory usage.

License
-------

[](#license)

MIT License

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance80

Actively maintained with recent releases

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity60

Established project with proven stability

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

Recently: every ~0 days

Total

21

Last Release

103d ago

Major Versions

1.0.2 → v2.x-dev2026-01-31

PHP version history (2 changes)1.0.0PHP &gt;=7.4

v2.x-devPHP &gt;=8.2

### Community

Maintainers

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

---

Top Contributors

[![aksoyih](https://avatars.githubusercontent.com/u/54416061?v=4)](https://github.com/aksoyih "aksoyih (57 commits)")

---

Tags

debugdumpvar\_dumpddpretty-dump

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/aksoyih-better-dump/health.svg)

```
[![Health](https://phpackages.com/badges/aksoyih-better-dump/health.svg)](https://phpackages.com/packages/aksoyih-better-dump)
```

###  Alternatives

[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)[phalcon/dd

This package will add the `dd` and `dump` helpers to your Phalcon application.

24294.1k27](/packages/phalcon-dd)[php-sage/sage

☯ Insightful PHP debugging assistant.

5639.7k5](/packages/php-sage-sage)[ivoba/stop

nice output for debug functions for PHP 5.3

1041.9k5](/packages/ivoba-stop)[awesomite/var-dumper

The alternative for var\_dump function

1015.4k2](/packages/awesomite-var-dumper)

PHPackages © 2026

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