How can I catch a "catchable fatal error" on PHP type hinting?
- by Ho
Hello,
I am trying to implement Type Hinting of PHP5 on one of my class,
class ClassA {
public function method_a (ClassB $b)
{}
}
class ClassB {}
class ClassWrong{}
Correct usage:
$a = new ClassA;
$a->method_a(new ClassB);
producing error:
$a = new ClassA;
$a->method_a(new ClassWrong);
Catchable fatal error: Argument 1 passed to ClassA::method_a() must be an instance of ClassB, instance of ClassWrong given...
May I know if it is possible to catch that error(since it says "catchable")? and if yes, how?
Thank you.