Get a stack trace of a hung PHP script
<p>I have a script that runs from a cron job every night.  Recently, it has started totally freezing up after several minutes into the script, and I can't figure out why.  If this was Java, I could simply run <code>kill -3 PID</code> and it would print a thread dump in stdout.  Is there any equivalent in PHP, where I could get a dump of the current stack trace (and ideally memory info) on a running PHP script?</p>
