Re: [VOTE][RFC] Safe Casting Functions
| From: | Pascal Martin, AFUP | Date: | Sat, 29 Nov 2014 21:13:05 +0000 |
| Subject: | Re: [VOTE][RFC] Safe Casting Functions | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-79314@lists.php.net to get a copy of this message | ||
On 19/11/2014 21:39, Andrea Faulds wrote:
I am putting the Safe Casting Functions RFC to a vote. https://wiki.php.net/rfc/safe_cast#vote Voting starts today (2014-11-19) and ends in 10 days’ time (2014-11-29).Hi, Judging from the discussions we've had with other members of AFUP, I'm guessing we'd kind of be +0.5 to this. Having a proper definition of what is a valid int/float/string could prove useful, especially in a context of stronger typing (like scalar type-hints, which is one case this definition would be the most helpful). This definition would have to be considered as some kind of an *official* one, though -- and not just be used for a few functions. Staying within the context of this RFC, we'd probably prefer the try_*() version of those functions, which would be useful for validations -- even if throwing exceptions from regular non-OO functions is not quite (for now?) the PHP way. Not a full +1 though, mainly because these functions only feel like half-a-step towards stronger typing. -- Pascal MARTIN, AFUP - French UG http://php-internals.afup.org/