Andrea Faulds wrote on 10/12/2014 16:04:
On 9 Dec 2014, at 15:27, Rowan Collins <rowan.coll...@gmail.com> wrote:

Andrea Faulds wrote on 09/12/2014 14:10:
On 9 Dec 2014, at 13:23, Rowan Collins <rowan.coll...@gmail.com> wrote:

Note that in master, the messages have been changed to (correctly) not mention the C 
types, only the PHP ones, so it would be more like "expects parameter 1 to be 
integer, float (which is beyond integer range) given".
They... have? When did this happen? It's something I was very much in favour of 
and wanted to do myself, but I was unaware this had recently changed. Does that 
mean I'll have to redo the patch for this RFC? :(

Oh; maybe not. I'm confused now.

There's a commit making the change, I think in amongst the "64-bit" work: 
https://github.com/php/php-src/commit/63ea29a2067ce06e20dda861480d91624389f0f3

But then the current master seems to be back using the old wording (random 
example): 
https://github.com/php/php-src/blob/master/ext/curl/tests/curl_setopt_error.phpt
 (Also, lxr.php.net doesn't show the PHPT files at all? 
http://lxr.php.net/xref/PHP_TRUNK/ext/curl/tests/)

I actually prepared a PR a while ago to change everything, but master was a bit 
of a moving target at the time, so it probably needs a bit of work to rebase: 
https://github.com/php/php-src/pull/769 I didn't bother because I thought 
someone had beaten me to it, but maybe I should revisit it after all?
Hi!

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.

Thanks!

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.

Regards,
--
Rowan Collins
[IMSoP]

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

Reply via email to