Re: [VOTE][RFC] ZPP Failure on Overflow
| From: | Andrea Faulds | Date: | Wed, 10 Dec 2014 17:41:39 +0000 |
| Subject: | Re: [VOTE][RFC] ZPP Failure on Overflow | ||
| References: | 1 2 3 4 5 6 7 8 9 10 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-79530@lists.php.net to get a copy of this message | ||
Hi,
> On 10 Dec 2014, at 17:21, Rowan Collins <rowan.collins@gmail.com> wrote:
>
> Andrea Faulds wrote on 10/12/2014 16:04:
>>
>> It looks like those changes aren’t in master. Once this RFC passes, I’d very much like
>> to see a new attempt to make the names consistent, it’s something that’s bothered me. If this
>> was to be revisited, I think the names for IS_LONG and IS_BOOL should be “int” and “bool”
>> respectively, not “integer” and “boolean”, those feel more like proper type names. Also, it
>> might be worth making is_long an alias of is_int, rather than the reverse which is what we have now.
>
> Regarding the naming, "integer" and "boolean" are used throughout the
> manual, and are what is returned by gettype(). (Unfortunately, it returns "double" for
> floats, but it's probably not worth the BC pain of changing that.) On the other hand,
> var_dump() uses "int" and "bool", and is_int() and is_bool() are the documented
> function names, so there is some precedent either way I suppose.
>
> My personal opinion is that the abbrevs make the messages less user-friendly (remember, these
> messages are for ordinary PHP developers, not C gurus), and don't really have any advantage
> over the full words, but I'm willing to be persuaded otherwise.
I just want it to be consistent, really. With the old Scalar Type Hinting RFC, I ended up reserving
the type names “int”, “float”, “string” and “bool”. The problem is that we also call
ints “integers” and bools “booleans”, and I’d prefer for us to choose one and stick with
it. “int” and “bool” are shorter, and I’m pretty sure PHP developers know what they are
(var_dump uses those, as you mentioned). They’re widely used in other languages, too. The manual
does use “integer” and “boolean”, but all the function signatures use “int” and
“bool”.
I suppose it doesn’t matter, ultimately, if we use “int” and “integer” or “bool” and
“boolean” interchangeably, except perhaps in future syntax to avoid adding too many reserved
words. What we need to eliminate is “double” and “long”.
--
Andrea Faulds
http://ajf.me/