title: register_shutdown_function is not getting called
body: <p>This is a snippet from my original code I am testing to handle error.</p>
  
  <p>The FIRST approach is calling the <code>fatalErrorHandler()</code>, but the SECOND approach is not calling the <code>fatalErrorHandler()</code>. What could be the reason?</p>
  
  <p><strong>FIRST</strong></p>
  
  <pre><code>&lt;?php 
  //error_reporting(0);
  
  function fatalErrorHandler() {
      echo 'YAY IT WORKED';
  }
  
  # Registering shutdown function
  register_shutdown_function('fatalErrorHandler');
  
  // let force a Fatal error -- function does not exist
  functiontest();
  
  echo "hello";
  
  ?&gt;
  </code></pre>
  
  <blockquote>
    <p><strong>output:</strong></p>
    
    <p>Fatal error: Call to undefined function functiontest() in ...test2.php
    on line 12 YAY IT WORKED</p>
  </blockquote>
  
  <p><strong>SECOND</strong></p>
  
  <pre><code> &lt;?php 
      //error_reporting(0);
  
      function fatalErrorHandler() {
          echo 'YAY IT WORKED';
      }
  
      # Registering shutdown function
      register_shutdown_function('fatalErrorHandler');
  
      // let force a Fatal error -- function does not exist
      functiontest();
  
      function foo () {
  
      }
  
      function foo() {
  
      }
  
      echo "hello";
  
      ?&gt;
  </code></pre>
  
  <p><strong>Output:</strong></p>
  
  <blockquote>
    <p>Fatal error: Cannot redeclare foo() (previously declared in
    ...test/test2.php:16) in ../test2.php on line 20</p>
  </blockquote>
  
  <p><strong>fatalErrorHandler is not getting called in this scenario. why?</strong></p>