Re: [VOTE][RFC] Safe Casting Functions
| From: | Levi Morrison | Date: | Wed, 19 Nov 2014 21:57:05 +0000 |
| Subject: | Re: [VOTE][RFC] Safe Casting Functions | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-79014@lists.php.net to get a copy of this message | ||
> Since some things might have changed since you last read the RFC, I encourage you to read
> through it again. If there are any questions which have not yet been covered on the mailing list,
> feel free to ask them.
- The RFC does not address how this is different from
FILTER_VALIDATE_* from ext/filter. I know there was a mention of this
on the mailing list, but the RFC should say why a tool that already
exists to solve this kind of problem is insufficient, especially when
it is enabled by default.
- PHP suffers a lot from function bloat and this RFC provides
multiple functions that do the same thing but differ only in how they
handle errors. A simple validation of "can this be safely cast to an
integer without dataloss?" avoid the issue entirely and would be fewer
functions.
To summarize: I like the idea of having tools that helps us convert
between types in a lossless way, but I don't think this proposal is
what is best for PHP. -1 for me but I hope to see this revisited.