title: Parse error: syntax error, unexpected 'catch' (T_CATCH)
body: <p>Why is this code causing a syntax error? Why can't I catch the exception?</p>
  
  <pre><code>protected function RunQuery($sql) {
      $pdo = $this-&gt;conn;
      $stmt = $pdo-&gt;prepare($sql);
  
      if($stmt) {
          $stmt-&gt;execute($sql);
      } else {
          print_r("Unable to prepare the query");
      }
      catch(PDOException $e) {
          print_r($e);
          exit(0);
      }
  } 
  </code></pre>