Re: [RFC] Coercive Scalar Type Hints
| From: | Ole Markus With | Date: | Sun, 22 Feb 2015 08:54:36 +0000 |
| Subject: | Re: [RFC] Coercive Scalar Type Hints | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-83461@lists.php.net to get a copy of this message | ||
On 02/21/2015 09:10 PM, Pádraic Brady wrote:
>
> On the RFC rules themselves, a few comments:
>
> 1. Happy to see leading/trailing spaces excluded.
> 2. Rules don't make mention of leading zeroes, e.g. 0003
> 3. "1E07" might be construed as overly generous assuming we are
> excluding stringy integers like hex, oct and binary
> 4. I'm assuming the stringy ints are rejected?
> 5. Is ".32" coerced to float or only "0.32"? Merely for clarification.
> 6. Boolean coercion from other types... Not entirely sure myself.
> Completely off the cuff: <=0: false, >0:true, floats and strings need
> not apply.
> 7. In string to float, only capital E or also small e?
> 8. I'll never stop call them "stringy" ints.
>
In my mind, certainly a better proposition than those introducing dual
mode. Agree with the comments above, except that I am entirely sure that
boolean coercion from other types should not be allowed.
Cheers,
Ole Markus