Re: Type hinting - Request for Discussion
| From: | Alban | Date: | Fri, 10 Jul 2009 14:57:22 +0000 |
| Subject: | Re: Type hinting - Request for Discussion | ||
| References: | 1 2 3 4 5 6 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-44914@lists.php.net to get a copy of this message | ||
Le Fri, 10 Jul 2009 14:23:24 +0100, Alain Williams a écrit :
> On Fri, Jul 10, 2009 at 08:45:55AM -0400, Alban wrote:
>> Hello all,
>>
>> I don't understand why you focus on " Strict / Weak " question.
>
> It is really about:
>
> * type checking and enforcement
> or
> * type casting and generation of an error if the value cannot be
> converted cleanly
Thank for your response !
I vote for throw an exception if data type won't match. Have one error
when you make a mistake is better than have a silently casting which can
transform your data in another form than what you want.
And Exception is better than an Error because this give one chance to
programmer for resolving the problem before program be halted.