Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:80164 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 63080 invoked from network); 5 Jan 2015 00:08:28 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Jan 2015 00:08: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 192.64.116.199 as permitted sender) X-PHP-List-Original-Sender: ajf@ajf.me X-Host-Fingerprint: 192.64.116.199 imap11-2.ox.privateemail.com Received: from [192.64.116.199] ([192.64.116.199:33534] helo=imap11-2.ox.privateemail.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 2C/D0-57266-AF5D9A45 for ; Sun, 04 Jan 2015 19:08:27 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.privateemail.com (Postfix) with ESMTP id A715B8800DB; Sun, 4 Jan 2015 19:08: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 Sa7mXm7Xcp8I; Sun, 4 Jan 2015 19:08:23 -0500 (EST) Received: from [192.168.0.13] (unknown [94.13.96.117]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.privateemail.com (Postfix) with ESMTPSA id 520278800E5; Sun, 4 Jan 2015 19:08:22 -0500 (EST) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 8.1 \(1993\)) In-Reply-To: <54A9D39F.8010808@gmail.com> Date: Mon, 5 Jan 2015 00:07:49 +0000 Cc: Derick Rethans , PHP Internals Content-Transfer-Encoding: quoted-printable Message-ID: References: <41D5BB0B-73AF-488E-968D-90B2878E3178@ajf.me> <54A466CB.9020400@gmail.com> <54A9D39F.8010808@gmail.com> To: Stanislav Malyshev X-Mailer: Apple Mail (2.1993) Subject: Re: [PHP-DEV] [RFC] Scalar Type Hints From: ajf@ajf.me (Andrea Faulds) Hi Stas, > On 4 Jan 2015, at 23:58, Stanislav Malyshev = wrote: >=20 >> I think it's perfectly acceptable that PHP makes a built-in type a=20 >> reserved word. I would certainly not change it to PHPInt to "avoid = any=20 >> obvious clashes". >=20 > As I already pointed out, if we make it reserved word we'll have BC > problem. We already had this experience when goto became reserved word = - > it resulted in a lot of breakage. This would be bigger, since we = adding > more reserved words and we know they are used in a lot of class names > (and, possibly, method names too). It is a BC problem, yes. However, it can be worked around in userland in = a way where unchanged code will continue to work on PHP 5, and changed = code will work on both PHP 5 and PHP 7. I think the BC break is worth = it, though unfortunate. I also wonder why we hadn=92t reserved these = names before, it seems rather silly that you were ever able to make a = class called =93integer=94 or =93array=94. By the way, we might want to pre-reserve `resource` as well. This RFC = intentionally does not add a type hint for it, but we may wish to do so = in future. It might also help with the migration to classes, too, as = this would stop userland developers creating classes called =93Resource=94= in the global namespace that would cause a future conflict. Thoughts? -- Andrea Faulds http://ajf.me/