Re: Type hinting
| From: | Chad Fulton | Date: | Tue, 01 Jun 2010 23:41:10 +0000 |
| Subject: | Re: Type hinting | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-48601@lists.php.net to get a copy of this message | ||
Hi!
> Pretty much everywhere. Suppose you have form with, say, 2 fields and first
> field does not validate. Maybe you want to check the second field too and
> give the user both errors if they are both wrong?
>
> In general, looking at strict typing as user input validation mechanism is a
> very bad idea. There are specialized use input validation
> functions/classes/frameworks, and one should use them.
Right, that was my point. I can't think of any good reason to use
exceptions rather than global errors (E_NOTICE or E_STRICT or
similar), but some people seem to want exceptions.
I was asking them if they had use valid cases (e.g. *not* data
validation or similar which is undoubtably foolish) that would merit
using exceptions rather than the global error handling.