title: How do I catch Uncaught TypeError fatal error?
body: <p>I have a method that accepts arguments of type <code>string</code> but they also could be <code>null</code>. How can I catch this fatal error? 
  <code>Fatal error: Uncaught TypeError: Argument 5 passed to Employee::insertEmployee() must be of the type string, null given,</code> 
  in the following code:</p>
  
  <pre><code>public function insertEmployee(string $first_name, string $middle_name, string $last_name, string $department, string $position, string $passport)
  {
      if($first_name == null || $middle_name == null || $last_name == null || $department == null || $position == null || $passport == null) {
          throw new InvalidArgumentException("Error: Please, check your input syntax.");
      }
      $stmt = $this-&gt;db-&gt;prepare("INSERT INTO employees (first_name, middle_name, last_name, department, position, passport_id) VALUES (?, ?, ?, ?, ?, ?)");
      $stmt-&gt;execute([$first_name, $middle_name, $last_name, $department, $position, $passport]);
      echo "New employee ".$first_name.' '.$middle_name.' '.$last_name.' saved.';
  }
  
  
  try {
      $app-&gt;insertEmployee($first_name, $middle_name, $last_name, $department, $position, $passport_id);
  } catch (Exception $ex) {
      echo $ex-&gt;getMessage();
  }
  </code></pre>