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(yesterday)01—0%MITPHPPHP ^8.4

Since Mar 20Pushed yesterdayCompare

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

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

42

—

FairBetter than 90% of packages

Maintenance100

Actively maintained with recent releases

Popularity2

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity50

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

1d 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

[filp/whoops

php error handling for cool kids

13.3k394.4M1.3k](/packages/filp-whoops)[symfony/stopwatch

Provides a way to profile code

2.8k379.8M774](/packages/symfony-stopwatch)[composer/xdebug-handler

Restarts a process without Xdebug.

2.6k390.6M73](/packages/composer-xdebug-handler)[beyondcode/laravel-dump-server

Symfony Var-Dump Server for Laravel

1.6k42.1M153](/packages/beyondcode-laravel-dump-server)[fruitcake/laravel-debugbar

PHP Debugbar integration for Laravel

19.1k253.2k13](/packages/fruitcake-laravel-debugbar)[spatie/ignition

A beautiful error page for PHP applications.

510143.5M56](/packages/spatie-ignition)

PHPackages © 2026

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