How do I effectively debug PHP applications? My current method is to use trace output - eg: die("message") and then fix the application from there. The problem is that this is often very cumbersome and inefficient. I would like to do something like this:
define('DEBUG', true);
debug({ print_r($arr); });
on_debug_die("application exit");
But I know that PHP doesn't support that kind of syntax. Can someone help me out?