Page 1 of 1

Type hinting and exceptions

Posted: Thu Jan 24, 2008 6:28 pm
by georgeoc
php manual wrote:Failing to satisfy the type hint results in a catchable fatal error.
I can't seem to make this work. When a type-hinting error is generated inside a try-catch block, the exception is not caught. Instead a E_RECOVERABLE_ERROR is generated. PHP 5.2.3.

Ta

Re: Type hinting and exceptions

Posted: Thu Jan 24, 2008 8:25 pm
by Ambush Commander
Try overloading the error handler. I don't think they mean "catch" as in try/catch style.

Re: Type hinting and exceptions

Posted: Fri Jan 25, 2008 5:33 am
by georgeoc
Oh I see. I was taking it too literally.

Thanks!