title: logging error within a call_user_func_array()
body: <p>How can I log a fatal error occuring within a call_user_func_array?
  Its within a CLI script that runs as a daemon.
  I would like to log when an error occurs, but instead it always throws the error message back.</p>
  
  <p>things that I tried but couldn't make it work:</p>
  
  <pre><code>try {call_user_func_array()} catch (Exception $e ) {do_log}
  </code></pre>
  
  <p>or</p>
  
  <pre><code>ob_start ();
  try {call_user_func_array()} catch (Exception $e ) {do_log}
  </code></pre>
  
  <p>or</p>
  
  <pre><code>register_shutdown_function('shutdownFunction');
  </code></pre>
  
  <p>or</p>
  
  <pre><code>ini_set('error_log',$baseDir.'/Jobque_error.log');
  fclose(STDIN);
  fclose(STDOUT);
  fclose(STDERR);
  $STDIN = fopen('/dev/null', 'r');
  $STDOUT = fopen($baseDir.'/Jobque_application.log', 'ab');
  $STDERR = fopen($baseDir.'/Jobque_daemon.log', 'ab');
  </code></pre>