Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:75971 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 79661 invoked from network); 23 Jul 2014 18:37:57 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Jul 2014 18:37:57 -0000 Authentication-Results: pb1.pair.com smtp.mail=ajf@ajf.me; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=ajf@ajf.me; sender-id=pass Received-SPF: pass (pb1.pair.com: domain ajf.me designates 192.64.116.216 as permitted sender) X-PHP-List-Original-Sender: ajf@ajf.me X-Host-Fingerprint: 192.64.116.216 imap10-3.ox.privateemail.com Received: from [192.64.116.216] ([192.64.116.216:39284] helo=imap10-3.ox.privateemail.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 6F/31-06925-30100D35 for ; Wed, 23 Jul 2014 14:37:56 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.privateemail.com (Postfix) with ESMTP id 0D74624005D; Wed, 23 Jul 2014 14:37:55 -0400 (EDT) X-Virus-Scanned: Debian amavisd-new at imap10.ox.privateemail.com Received: from mail.privateemail.com ([127.0.0.1]) by localhost (imap10.ox.privateemail.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id GtFL2f0PBmtU; Wed, 23 Jul 2014 14:37:54 -0400 (EDT) Received: from [192.168.0.15] (unknown [90.210.122.167]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.privateemail.com (Postfix) with ESMTPSA id 0B2022400C6; Wed, 23 Jul 2014 14:37:53 -0400 (EDT) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) In-Reply-To: <7E1578C5-30DE-46CE-B3CA-AFA9F7FA1B6B@thesba.com> Date: Wed, 23 Jul 2014 19:37:50 +0100 Cc: "internals@lists.php.net >> PHP Internals" Content-Transfer-Encoding: quoted-printable Message-ID: <53C02C31-BE27-4235-AF25-AE319067FD94@ajf.me> References: <08503591-EFC8-48E6-984E-FFC292C5EA5F@ajf.me> <53C2178E.7070705@sugarcrm.com> <53CB70BC.4020001@php.net> <53CC0A75.6010200@sugarcrm.com> <7E1578C5-30DE-46CE-B3CA-AFA9F7FA1B6B@thesba.com> To: Robert Williams X-Mailer: Apple Mail (2.1878.6) Subject: Re: [PHP-DEV] [RFC] Scalar Type Hinting With Casts (re-opening) From: ajf@ajf.me (Andrea Faulds) On 23 Jul 2014, at 19:21, Robert Williams wrote: > It seems odd to me to not support the aliases. Since I can do this: >=20 > $foo =3D (integer)$bar; >=20 > I would expect to be able to do this: >=20 > function foo(integer $param) {} Aliases mean inconsistency. We shouldn=92t unnecessarily have multiple = names for the same thing, just one. Also, for every alias we support, = another reserved word is added. Hence we only allow one set of names. = This is also Facebook=92s approach with Hack, which removes the aliases = entirely for type casting. I might propose we deprecate/remove the = aliases in a future RFC. > Also, do int, float, and numeric accept numbers in octal, hex, = scientific notation, etc.? I don=92t believe there are any examples in = the RFC that intentionally or accidentally show what happens with, say, = 0x2f as a value. Ooh, you=92ve caught me out there. The patch as it stands would permit = such non-decimal numbers, which isn=92t what it should do as = convert_to_long_base_safe should actually permit only the specified = base. So, yes it does permit non-decimal numbers, but it=92s a bug I need to = fix. -- Andrea Faulds http://ajf.me/