title: Does re-throwing an exception in PHP destroy the stack trace?
body: <p>In C#, doing the following would destroy the stack trace of an exception:</p>
  
  <pre class="lang-csharp prettyprint-override"><code>try{
      throw new RuntimeException();
  }
  catch(Exception e){
      //Log error
  
      //Re-throw
      throw e;
  }
  </code></pre>
  
  <p>Because of this, using <code>throw</code> rather than <code>throw e</code> is preferred. This will let the same exception propagate upwards, instead of wrapping it in a new one.</p>
  
  <p>However, using <code>throw;</code> without specifying the exception object is invalid syntax in PHP. Does this problem simply not exist in PHP? Will using throw $e as follows not destroy the stack trace?</p>
  
  <pre><code>&lt;?php
  
  try{
      throw new RuntimeException();
  }
  catch(Exception $e){
      //Log error
  
      //Re-throw
      throw $e;
  }
  </code></pre>