PHPackages                             achttienvijftien/dbgp-client - 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. achttienvijftien/dbgp-client

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

achttienvijftien/dbgp-client
============================

PHP DBGp protocol client library

1.0.0(1mo ago)01—0%MITPHPPHP ^8.4

Since Mar 20Pushed 1mo agoCompare

[ Source](https://github.com/achttienvijftien/dbgp-client)[ Packagist](https://packagist.org/packages/achttienvijftien/dbgp-client)[ RSS](/packages/achttienvijftien-dbgp-client/feed)WikiDiscussions main Synced 1mo ago

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

dbgp-client
===========

[](#dbgp-client)

A PHP client library for the [DBGp protocol](https://xdebug.org/docs/dbgp), the debugging protocol used by Xdebug.

Provides a clean, typed API for communicating with Xdebug: setting breakpoints, stepping through code, inspecting variables, evaluating expressions, and controlling execution flow.

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

[](#installation)

```
composer require achttienvijftien/dbgp-client
```

Requires PHP 8.4+.

Usage
-----

[](#usage)

### Listening for connections

[](#listening-for-connections)

The `Server` class listens for incoming Xdebug connections and returns a `Session`:

```
use DbgpClient\Server;

$server = new Server('127.0.0.1', 9003);
$server->listen();

// Block until Xdebug connects (30s timeout)
$session = $server->accept(30.0);

echo "Engine: {$session->init->engine->name} {$session->init->engine->version}\n";
echo "File: {$session->init->fileUri}\n";
```

Then trigger a PHP script with Xdebug enabled:

```
php -d xdebug.mode=debug -d xdebug.start_with_request=yes -d xdebug.client_port=9003 your_script.php
```

### Breakpoints

[](#breakpoints)

```
use DbgpClient\Type\BreakpointType;

// Line breakpoint
$bp = $session->breakpointSet(BreakpointType::Line, 'file:///path/to/script.php', 42);
echo "Breakpoint ID: {$bp->id}\n";

// Conditional breakpoint
$session->breakpointSet(BreakpointType::Conditional, expression: '$count > 10');

// Remove a breakpoint
$session->breakpointRemove($bp->id);

// List all breakpoints
$list = $session->breakpointList();
```

### Execution control

[](#execution-control)

```
// Run until breakpoint or end
$response = $session->run();
echo "Status: {$response->status->value}\n"; // "break" or "stopping"

// Stepping
$session->stepOver();
$session->stepInto();
$session->stepOut();

// Stop execution
$session->stop();
```

### Inspecting state

[](#inspecting-state)

```
// Stack trace
$stack = $session->stackGet();
foreach ($stack->stack as $frame) {
    echo "#{$frame->level} {$frame->filename}:{$frame->lineno}";
    if ($frame->where) {
        echo " in {$frame->where}";
    }
    echo "\n";
}

// Local variables
$context = $session->contextGet();
foreach ($context->properties as $prop) {
    echo "{$prop->name} ({$prop->type}) = {$prop->value}\n";
}

// Inspect a specific variable (with nested expansion)
$prop = $session->propertyGet('$myArray', maxDepth: 2);

// Evaluate an expression
$result = $session->eval('$x + $y');
echo "Result: {$result->properties[0]->value}\n";
```

### Async commands

[](#async-commands)

For event-loop integration, use `sendCommandAsync` to send execution commands without blocking:

```
// Send run command, returns immediately with a transaction ID
$txId = $session->sendCommandAsync('run');

// ... do other work, use stream_select() on the connection ...

// Read the response when data is available
$response = $session->readResponse();
```

### Raw commands

[](#raw-commands)

For DBGp commands not covered by the convenience methods:

```
$response = $session->sendCommand('feature_get', ['-n' => 'max_depth']);
echo $response->rawXml->asXML();
```

License
-------

[](#license)

MIT

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance90

Actively maintained with recent releases

Popularity2

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity51

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

Unknown

Total

1

Last Release

51d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6b266fbc7c6022e0bd39e3e1f06d75029dda33bae8d4a109d79824cb6f3bbf18?d=identicon)[dennisenderink](/maintainers/dennisenderink)

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

![](https://www.gravatar.com/avatar/25ddb3567dc50c66226060bf3be9ea79e580f8c16852a021f2b0c007af75d06f?d=identicon)[tmdk](/maintainers/tmdk)

---

Top Contributors

[![tmdk](https://avatars.githubusercontent.com/u/690621?v=4)](https://github.com/tmdk "tmdk (1 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/achttienvijftien-dbgp-client/health.svg)

```
[![Health](https://phpackages.com/badges/achttienvijftien-dbgp-client/health.svg)](https://phpackages.com/packages/achttienvijftien-dbgp-client)
```

###  Alternatives

[symfony/stopwatch

Provides a way to profile code

2.8k387.2M917](/packages/symfony-stopwatch)[fruitcake/laravel-debugbar

PHP Debugbar integration for Laravel

19.1k662.9k28](/packages/fruitcake-laravel-debugbar)[spatie/ignition

A beautiful error page for PHP applications.

510147.6M69](/packages/spatie-ignition)[jokkedk/webgrind

Webgrind is a Xdebug profiling web frontend in PHP5. It implements a subset of the features of kcachegrind and installs in seconds and works on all platforms. For quick'n'dirty optimizations it does the job.

3.3k193.0k](/packages/jokkedk-webgrind)[koriym/printo

An object graph visualizer.

1421.8M2](/packages/koriym-printo)[soloterm/dumps

A Laravel command to intercept dumps from your Laravel application.

125285.7k3](/packages/soloterm-dumps)

PHPackages © 2026

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