Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Debugging PHP

I've been using xdebug to debug and understand code in php projects for a while now, and have sometimes come into situations where it's been unclear what's going on inside of PHP.

Is it possible to set xdebug or gdb up so that i can trace into actual php builtin functions?

like image 279
xkcd150 Avatar asked Nov 24 '25 06:11

xkcd150


2 Answers

If you are using a macosx, solaris or recent freebsd system you can throw a little dtrace at it. It can come in handy for those all too numerous "WTF is PHP doing?" moments.

like image 119
Trey Avatar answered Nov 26 '25 22:11

Trey


I doubt it, xdebug is intended for tracing your PHP code, not the internals. The internals are assumed to be bug-free (which obviously they aren't sometimes, but that's beyond the scope of xdebug).

You can always look at the PHP source if you want to know what the built-in functions do, but that's sometimes pretty hairy. The PHP manual docs have always served me well enough when I want to know what they'll do.

like image 35
dirtside Avatar answered Nov 26 '25 22:11

dirtside



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!