Say you have a large PHP project and suddenly, when attempting to run it, you just end up with a blank page. The script terminates and you want to find exactly where that is
Make sure that errors are displayed in your development environment (not production).
xdebug has a nice trace feature that'll allow you to see all the entire trace of your php app execution and it should give you give clue as to where your exit is.
but for the quick and dirty solution a grep/find as mentioned above will do rightly.
I use the following code and need no special debugging environment. Note that this might take really long; you can set the ticks count higher - that makes it faster, but blurry.
function shutdown_find_exit()
{
var_dump($GLOBALS['dbg_stack']);
}
register_shutdown_function('shutdown_find_exit');
function write_dbg_stack()
{
$GLOBALS['dbg_stack'] = debug_backtrace();
}
register_tick_function('write_dbg_stack');
declare(ticks=1);