Hi,

> On 10 Dec 2014, at 17:21, Rowan Collins <rowan.coll...@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/





--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to