title: How can I debug segmentation faults in the PHP CLI?
body: <p>I have written some code that I run remotely on a server via the php-cli and a particular method within this code (I'm unsure <em>which method</em> at the moment) is causing a <code>segmentation fault</code>.</p>
  
  <p>Apart from adding <code>exit</code> and <code>echo</code> calls down through my methods and manually pinpointing the bad bits -  <strong>is there a way to catch the segmentation fault as it happens</strong> and find out what piece of the puzzle is crashing? Standard PHP errors are displayed through the error shutdown handlers, I'm unsure where to start with this segmentation fault.</p>
  
  <p>Cheers!</p>