KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
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... Is it possible to catch that error(since it says "catchable")? and if yes, how?
Tags (comma-separated)
Save Edits
Cancel