PHPackages                             chevere/xr - 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. chevere/xr

Abandoned → [xrdebug/php](/?search=xrdebug%2Fphp)Library[Debugging &amp; Profiling](/categories/debugging)

chevere/xr
==========

PHP client library for xrDebug

3.0.4(1mo ago)2399.0k—0%6[4 issues](https://github.com/xrdebug/php/issues)3Apache-2.0PHPPHP ^8.1CI passing

Since Jan 10Pushed 1mo ago4 watchersCompare

[ Source](https://github.com/xrdebug/php)[ Packagist](https://packagist.org/packages/chevere/xr)[ Docs](https://github.com/xrdebug/php)[ RSS](/packages/chevere-xr/feed)WikiDiscussions 3.0 Synced 1mo ago

READMEChangelog (10)Dependencies (11)Versions (39)Used By (3)

xrDebug PHP client
==================

[](#xrdebug-php-client)

[![xrDebug](xr.svg)](https://xrdebug.com)

[![Build](https://camo.githubusercontent.com/057e749d5836dbc2c6c0d8784b7efacf5562b6cfdacffaedf815296d1ec5230b/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f787264656275672f7068702f746573742e796d6c3f6272616e63683d332e30267374796c653d666c61742d737175617265)](https://github.com/xrdebug/php/actions)[![Code size](https://camo.githubusercontent.com/342528c2bf3f02f926a2808243f370110fc059ef2968f438b84de05ddd78cf96/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c616e6775616765732f636f64652d73697a652f787264656275672f7068703f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/342528c2bf3f02f926a2808243f370110fc059ef2968f438b84de05ddd78cf96/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c616e6775616765732f636f64652d73697a652f787264656275672f7068703f7374796c653d666c61742d737175617265)[![Apache-2.0](https://camo.githubusercontent.com/67731a89c9b2216a50f108f452ead84e78b1b689bc45e8ada6126b3c9cdfc951/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f787264656275672f7068703f7374796c653d666c61742d737175617265)](LICENSE)[![PHPStan](https://camo.githubusercontent.com/6016298b28550819030c76e9327f62501596a31fd76406695bae2f3d2a1f26a4/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048505374616e2d6c6576656c253230392d626c756576696f6c65743f7374796c653d666c61742d737175617265)](https://phpstan.org/)[![Mutation testing badge](https://camo.githubusercontent.com/8d6f285d6357844d24f83ac17d5ac4d02ea5054e2639fdba66147e0a935af2f1/68747470733a2f2f696d672e736869656c64732e696f2f656e64706f696e743f7374796c653d666c61742d7371756172652675726c3d687474707325334125324625324662616467652d6170692e737472796b65722d6d757461746f722e696f2532466769746875622e636f6d25324678726465627567253246706870253246332e30)](https://dashboard.stryker-mutator.io/reports/github.com/xrdebug/php/3.0)

[![Quality Gate Status](https://camo.githubusercontent.com/65a9f8c937f3e4973c59d9fcb6ca1809b4b52581b411b54fa4d1f4de19333ea7/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d787264656275675f706870266d65747269633d616c6572745f737461747573)](https://sonarcloud.io/dashboard?id=xrdebug_php)[![Maintainability Rating](https://camo.githubusercontent.com/c441c570a64df1cb5697ef47a90134dd89370340a1658d6e5b6ba14cc52dafd7/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d787264656275675f706870266d65747269633d7371616c655f726174696e67)](https://sonarcloud.io/dashboard?id=xrdebug_php)[![Reliability Rating](https://camo.githubusercontent.com/cd6219bf61853e29513302d9e68827d5349094c4a13072c9c2fd26085453b954/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d787264656275675f706870266d65747269633d72656c696162696c6974795f726174696e67)](https://sonarcloud.io/dashboard?id=xrdebug_php)[![Security Rating](https://camo.githubusercontent.com/3347ccf600c7bbda275f32ede4f28e28b44d7132f06bed254cb78327f712fdea/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d787264656275675f706870266d65747269633d73656375726974795f726174696e67)](https://sonarcloud.io/dashboard?id=xrdebug_php)[![Coverage](https://camo.githubusercontent.com/ac7ac7ead55a90525b10229dd964e368b90bb5593c2e0d6111c85cf886771da1/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d787264656275675f706870266d65747269633d636f766572616765)](https://sonarcloud.io/dashboard?id=xrdebug_php)[![Technical Debt](https://camo.githubusercontent.com/30c1d4c0732ff37576bf20787242b76a7595ce1035655d407b4f5260f50d017a/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d787264656275675f706870266d65747269633d7371616c655f696e646578)](https://sonarcloud.io/dashboard?id=xrdebug_php)[![CodeFactor](https://camo.githubusercontent.com/fd317c3858bec757793e4901eec7aa21f911b2fa9ec05720443f380fe1b994ae/68747470733a2f2f7777772e636f6465666163746f722e696f2f7265706f7369746f72792f6769746875622f787264656275672f7068702f6261646765)](https://www.codefactor.io/repository/github/xrdebug/php)

Summary
-------

[](#summary)

PHP client library for [xrDebug](https://xrdebug.com/). This library provides a set of functions to dump variables, send raw messages, and interact with the inspector from your codebase.

Quick start
-----------

[](#quick-start)

Install using [Composer](https://packagist.org/packages/xrdebug/php).

```
composer require --dev xrdebug/php
```

Use `xr()` directly in your code to dump any variable. For example:

```
require_once __DIR__ . '/vendor/autoload.php';

// ...
xr('Hello, world!');
```

Configuring
-----------

[](#configuring)

This xrDebug PHP client uses the following default configuration.

> Skip this section if running from the xrDebug binary and on the same machine.

```
[
    'isEnabled' => true,
    'isHttps' => false,
    'host' => 'localhost',
    'port' => 27420,
    'key' => '',
    'localPath' => '',
    'remotePath' => '',
]
```

PropertyTypeEffectisEnabledboolControls sending messages to the serverisHttpsboolControls use of httpshoststringThe host where xrDebug server is runningportintThe Port to connect to the `host`keystringPrivate key (ed25519) for signed requestslocalPathstringLocal path to project rootremotePathstringRemote path to project root- `host`: When running xrDebug on Docker use `host.docker.internal`.
- `localPath` `remotePath`: When using xrDebug on a remote machine or Docker, set these properties to enable file links. `localPath` is the path to your project on your machine, while `remotePath` is the path to the same project on the remote machine or Docker.

```
    'localPath' => '/Users//Code', # C:\Users\\Documents\Code on Windows
    'remotePath' => '/home/vagrant/Code',
```

### File-based config

[](#file-based-config)

Configure the client by placing a `xr.php` file in project's root directory. Need to define only the properties that override the default config.

We recommend adding `xr.php` to your `.gitignore`.

Here some examples of `xr.php`:

- Run with Docker at a `27980` port:

    ```
