---
title: "I built a free, open-source alternative var_dump() — real-time PHP debugging in the browser"
url: https://daily.dev/posts/i-built-a-free-open-source-alternative-var-dump-real-time-php-debugging-in-the-browser-mo5pxj73r
source_url: https://daily.dev/posts/i-built-a-free-open-source-alternative-var-dump-real-time-php-debugging-in-the-browser-mo5pxj73r
type: freeform
source: "PHP Dev"
author: "Leon"
published: 2026-02-19T10:56:02.111Z
updated: 2026-05-21T02:14:51.197Z
tags: ["open-source", "php", "server-sent-events"]
reading_time: 3
upvotes: 10
comments: 7
language: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# I built a free, open-source alternative var_dump() — real-time PHP debugging in the browser

**[PHP Dev](https://daily.dev/sources/phpdev)** · [@callmeleon](https://daily.dev/callmeleon) · 3 min read · 10 upvotes · 7 comments

## Summary

DebugPHP is a free, open-source PHP debugging tool that streams debug output to a browser-based dashboard in real-time using Server-Sent Events — no page reloads, no IDE integration, no desktop apps required. It offers a simple API via `Debug::send()` with support for labels, colors, inline timers, toolbar metrics, and array tables. The server component is fully self-hostable, requires PHP 8.1+ with only `ext-curl`, passes PHPStan Level 10 static analysis, and is installable via Composer. It positions itself as a free alternative to tools like Spatie Ray.

## Content

![Screenshot 2026-02-18 140400.png](https://media.daily.dev/image/upload/s--Rg2D3-nB--/f_auto/v1771497957/ugc/content_7307b08e-d8dc-4abb-8d18-05518b43200f?_a=BAMAMiiu0)

For years I've been juggling `var_dump()`, Xdebug setups, and paying for tools like Spatie Ray ($49/year) just to see what my PHP app is doing. None of it felt right — either it broke the page, needed heavy IDE integration, or cost money for something that should be free.

So I built **DebugPHP**.

---

## What it does

DebugPHP streams your debug output to a browser-based dashboard in real-time via **Server-Sent Events**. No page reloads. No desktop apps. No config hell. Just call `Debug::send()` and watch it appear.

```
use DebugPHP\Debug;

Debug::init('your-session-token');

Debug::send('User created!');
Debug::send($user, 'User')->color('blue');
Debug::send($exception, 'Error')->color('red');
```

---

## Current features

**Labels & Colors** — categorize your entries visually:

```
Debug::send($query, 'SQL')->color('blue');
Debug::send($error, 'Error')->color('red');
```

**Timers** — measure performance inline:

```
Debug::startTimer('db-query');
$results = $db->query('SELECT * FROM users');
Debug::stopTimer('db-query');
// → Dashboard shows: "db-query: 23.4ms"
```

**Toolbar Metrics** — live key-value chips in the topbar, perfect for request-level data:

```
Debug::metric('Template', 'home.php');
Debug::metric('Memory', memory_get_usage(true) / 1024 / 1024 . 'MB');
```

Metrics auto-disappear from the toolbar when you remove them from your code — no stale data.

**Tables** — render arrays as proper tables:

```
Debug::table([
    ['name' => 'Leon', 'role' => 'Developer'],
    ['name' => 'Sarah', 'role' => 'Designer'],
]);
```

**Pause / Resume / Clear** — full control without touching your app.

---

## Self-hostable

Don't want your debug data leaving your machine? The server component is fully open source too:

```
git clone https://github.com/CallMeLeon167/debugphp-server.git
cd debugphp-server
composer install
# Open /setup/ in the browser — the wizard does the rest
```

Then just point the client at your own server:

```
Debug::init('your-token', [
    'host' => 'http://localhost:8080',
]);
```

---

## Technical details (for those who care)

- **PHP 8.1+** required, zero runtime dependencies (just `ext-curl`)
- **PHPStan Level 10** — the strictest static analysis level, fully passing
- **SSE-based** push architecture — no WebSocket server needed, works on any standard Apache/nginx setup
- Data is serialized with PHP's native `serialize()` + base64 for full type fidelity (objects, exceptions, nested structures all work)
- Session tokens tie your app to your dashboard tab — multiple sessions work in parallel

---

## Installation

```
composer require callmeleon167/debugphp --dev
```

Requires PHP 8.1+ and `ext-curl`. That's it.

---

## Status

Currently in **pre-release** — the core is working and the dashboard is functional, but I'm still polishing things before the public launch on GitHub.

If this sounds useful to you: feel free to open issues or drop feedback here. I'm especially curious whether the self-hosted setup flow works smoothly on different environments.

---

_Built by a PHP dev, for PHP devs. MIT licensed._

## Community discussion

Top comments from developers on daily.dev.

**@fanmade** · 2 upvotes

> Yeah, I would also like to check it out.
> XDebug is still the best method, but it's just always annoying to set up and often too much effort to set up for quick debugging.
> So please make the repository public and give an update when it's available :)

**@tecnolive** · 1 upvotes

> The repository returns a 404 error; it appears to be private.

## Similar posts on daily.dev

- [PHP Debugger: A Lightweight Xdebug Alternative Built for Speed](https://daily.dev/posts/php-debugger-a-lightweight-xdebug-alternative-built-for-speed-w7zvlhyc6) · Laravel News · 28 upvotes · 1 comments

---

Tags: [#open-source](https://daily.dev/tags/open-source), [#php](https://daily.dev/tags/php), [#server-sent-events](https://daily.dev/tags/server-sent-events)

[View this post on daily.dev](https://daily.dev/posts/i-built-a-free-open-source-alternative-var-dump-real-time-php-debugging-in-the-browser-mo5pxj73r)
