title: How can I catch a "catchable fatal error" on PHP type hinting?
body: <p>I am trying to implement Type Hinting of PHP5 on one of my class,</p>
  
  <pre><code>class ClassA {
      public function method_a (ClassB $b)
      {}
  }
  
  class ClassB {}
  class ClassWrong{}
  </code></pre>
  
  <p>Correct usage:</p>
  
  <pre><code>$a = new ClassA;
  $a-&gt;method_a(new ClassB);
  </code></pre>
  
  <p>producing error:</p>
  
  <pre><code>$a = new ClassA;
  $a-&gt;method_a(new ClassWrong);
  </code></pre>
  
  <blockquote>
    <p><b>Catchable fatal error: Argument 1 passed to ClassA::method_a() must be an instance of ClassB, instance of ClassWrong given...</b></p>
  </blockquote>
  
  <p>Is it possible to catch that error(since it says "catchable")? and if yes, how?</p>