FOR PHP DEVELOPERS

An Xdebug alternative?
Only for one of its jobs.

Xdebug does several things, and most of them have no good replacement. If you want to step through a request line by line, stop reading: keep Xdebug, we do not do that and we are not going to pretend otherwise. There is exactly one job where Xdebug is the wrong tool, and it is the one that sent you here — finding out why something is slow in production.

Keep Xdebug for these

Modes and their names as the Xdebug documentation lists them, read on 22 September 2026: off, develop, debug, trace, coverage, gcstats, profile.

Where it stops: production

You cannot turn it on for one request

xdebug.mode is read from php.ini at startup — it is not a per-request switch. So "just enable the profiler for the slow checkout" means enabling it for every request on that worker, then restarting PHP to turn it off again.

The cost is not documented, so we measured it

Xdebug's own documentation says only that off gives "close to 0 overhead". It puts no number on the other modes. We ran xdebug.mode=profile against a real WordPress page and published the method with the raw figures:

And the request already happened

The profiler records what you profile from now on. The checkout that took nine seconds at 3 a.m. is gone, and you cannot reproduce it — that is usually the whole problem.

What PHPRay does instead

It records every request, all the time, and keeps it: wall time, CPU, memory, SQL fingerprints with the literals stripped, outbound HTTP, PHP errors, N+1 patterns. You open yesterday's slow request instead of trying to recreate it today.

That is only honest if the recording is cheap, so here is our own number on the same WordPress page: 40.7 ms against a 40.2 ms baseline — inside the noise. Per-function attribution, which is the part that resembles what Xdebug's profiler gives you, is sampled and costs about 4% on that page; on a 48 ms micro-benchmark it cost 27%, and we published that row too.

Side by side

Xdebug (profile mode)PHPRay
Made forOne request you can reproduce, locally Every request, where it actually happens
Turning it onphp.ini + restart; all requests on that worker Always on; per-function profiling sampled, or scoped to one URL for a few minutes
Measured cost25× slower on our test page 40.7 ms vs 40.2 ms baseline — within noise
Output size~40 MB per profiled request (1.2 GB from sixty) One row per request in SQLite; retention is a setting
Step debuggingYes — and this is why you keep itNo
Code coverageYesNo
Full call graphYes, completeComponent and function attribution on a sample
Shared hostingDepends on the host enabling it Extension if you can load one; a WordPress plugin in pure PHP if you cannot
LicenceXdebug licence, open sourceApache-2.0 core

The short version

Measure it on your own page

Install locally in one line — open source, Apache-2.0, no account, no card. Or let an agent look at recorded data first: our MCP endpoint answers without any install.

Install it locally Ask an agent instead

Read next