title: php: try-catch not catching all exceptions
body: <p>I'm trying to do the following:</p>
  
  <pre><code>try {
      // just an example
      $time      = 'wrong datatype';
      $timestamp = date("Y-m-d H:i:s", $time);
  } catch (Exception $e) {
      return false;
  }
  // database activity here
  </code></pre>
  
  <p>In short: I initialize some variables to be put in the database. If the initialization fails for whatever reason - e.g. because $time is not the expected format - I want the method to return false and not input wrong data into the database.</p>
  
  <p>However, errors like this are not caught by the 'catch'-statement, but by the global error handler. 
  And then the script continues.</p>
  
  <p>Is there a way around this? I just thought it would be cleaner to do it like this instead of manually typechecking every variable, which seems ineffective considering that in 99% of all cases nothing bad happens.</p>