Joe Watkins, core PHP developer and author of (amongst many other things) ptrheads, is busy creating a PHP debugger written in PHP that you can just composer require.

This isn't just pipe dreams, the PHP code exists, it's alpha quality and largely untested ...There is much to do and you shouldn't design your workflow around this (or any alpha quality software) yet. What you should do is start reading code, testing, and opening pull requests...

http://blog.krakjoe.ninja/2018/06/preface-to-idbg.html

You'll find the code of Joe's debugger in this repo on GitHub.