Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:79530 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 44259 invoked from network); 10 Dec 2014 17:44:28 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Dec 2014 17:44:28 -0000 Authentication-Results: pb1.pair.com header.from=ajf@ajf.me; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=ajf@ajf.me; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain ajf.me designates 198.187.29.245 as permitted sender) X-PHP-List-Original-Sender: ajf@ajf.me X-Host-Fingerprint: 198.187.29.245 imap11-3.ox.privateemail.com Received: from [198.187.29.245] ([198.187.29.245:40087] helo=imap11-3.ox.privateemail.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 38/B2-29826-B7688845 for ; Wed, 10 Dec 2014 12:44:28 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.privateemail.com (Postfix) with ESMTP id 4DA9E8801A0; Wed, 10 Dec 2014 12:44:23 -0500 (EST) X-Virus-Scanned: Debian amavisd-new at imap11.ox.privateemail.com Received: from mail.privateemail.com ([127.0.0.1]) by localhost (imap11.ox.privateemail.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 4JNNINy3yQjF; Wed, 10 Dec 2014 12:44:21 -0500 (EST) Received: from oa-res-26-240.wireless.abdn.ac.uk (oa-res-26-240.wireless.abdn.ac.uk [137.50.26.240]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.privateemail.com (Postfix) with ESMTPSA id CF21E8800FF; Wed, 10 Dec 2014 12:41:40 -0500 (EST) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 8.1 \(1993\)) In-Reply-To: <5488810B.7050804@gmail.com> Date: Wed, 10 Dec 2014 17:41:39 +0000 Cc: "internals@lists.php.net" Content-Transfer-Encoding: quoted-printable Message-ID: <6E059C9E-DBA9-467B-A977-386846A1A2AC@ajf.me> References: <24634FCA-EB3E-4805-A6D6-A1587A56C141@ajf.me> <42CB63B7-BB58-4A48-A738-08EF73D4395B@ajf.me> <5486F7BF.4070907@gmail.com> <548714D0.2010003@gmail.com> <2C28A252-4E07-4AB9-BDEC-5BB9DD7CA8F3@ajf.me> <5488810B.7050804@gmail.com> To: Rowan Collins X-Mailer: Apple Mail (2.1993) Subject: Re: [PHP-DEV] [VOTE][RFC] ZPP Failure on Overflow From: ajf@ajf.me (Andrea Faulds) Hi, > On 10 Dec 2014, at 17:21, Rowan Collins = wrote: >=20 > Andrea Faulds wrote on 10/12/2014 16:04: >>=20 >> It looks like those changes aren=92t in master. Once this RFC passes, = I=92d very much like to see a new attempt to make the names consistent, = it=92s something that=92s bothered me. If this was to be revisited, I = think the names for IS_LONG and IS_BOOL should be =93int=94 and =93bool=94= respectively, not =93integer=94 and =93boolean=94, 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. >=20 > 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. >=20 > 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 =93int=94, =93float=94, = =93string=94 and =93bool=94. The problem is that we also call ints = =93integers=94 and bools =93booleans=94, and I=92d prefer for us to = choose one and stick with it. =93int=94 and =93bool=94 are shorter, and = I=92m pretty sure PHP developers know what they are (var_dump uses = those, as you mentioned). They=92re widely used in other languages, too. = The manual does use =93integer=94 and =93boolean=94, but all the = function signatures use =93int=94 and =93bool=94. I suppose it doesn=92t matter, ultimately, if we use =93int=94 and = =93integer=94 or =93bool=94 and =93boolean=94 interchangeably, except = perhaps in future syntax to avoid adding too many reserved words. What = we need to eliminate is =93double=94 and =93long=94. -- Andrea Faulds http://ajf.me/