Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:89377 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 6436 invoked from network); 24 Nov 2015 15:42:15 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Nov 2015 15:42:15 -0000 Authentication-Results: pb1.pair.com smtp.mail=theodorejb@outlook.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=theodorejb@outlook.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain outlook.com designates 65.54.190.150 as permitted sender) X-PHP-List-Original-Sender: theodorejb@outlook.com X-Host-Fingerprint: 65.54.190.150 bay004-omc3s12.hotmail.com Received: from [65.54.190.150] ([65.54.190.150:65173] helo=BAY004-OMC3S12.hotmail.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 24/F6-57156-45584565 for ; Tue, 24 Nov 2015 10:42:14 -0500 Received: from BAY178-W25 ([65.54.190.189]) by BAY004-OMC3S12.hotmail.com over TLS secured channel with Microsoft SMTPSVC(7.5.7601.23008); Tue, 24 Nov 2015 07:42:10 -0800 X-TMN: [UkgspZ/zlTxHP6W2N1a96xdXbhhalzcx] X-Originating-Email: [theodorejb@outlook.com] Message-ID: To: Ryan Pallas , Sebastian Bergmann CC: "internals@lists.php.net" Date: Tue, 24 Nov 2015 09:42:09 -0600 Importance: Normal In-Reply-To: References: <56547DFE.3080407@php.net>, Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginalArrivalTime: 24 Nov 2015 15:42:10.0100 (UTC) FILETIME=[AE5E7740:01D126CE] Subject: RE: [PHP-DEV] Scalar Type Declaration Syntax Weirdness From: theodorejb@outlook.com (Theodore Brown) > On Tue=2C Nov 24=2C 2015 at 8:10 AM=2C Sebastian Bergmann =0A= > wrote:=0A= >=0A= >> The following is currently valid PHP 7 code=0A= >>=0A= >> > function a(\int $i) {}=0A= >>=0A= >> Is it intentional that the \ in front of the "int" is allowed? IMHO=2C t= his=0A= >> confusing notation must not be allowed.=0A= >>=0A= >>=0A= >> Why not? Its a root level type=2C you can prefix a \ on any other root l= evel=0A= > type that's valid for use in type hinting.=0A= >=0A= > function a(\DateTime $d) {}=0A= > function b(\SplFileObject $f) {}=0A= >=0A= > Also=2C this is the only way to get some IDEs to recognize the type when = in a=0A= > namespace (at least currently).=0A= =0A= The difference is that DateTime and \DateTime mean different things inside = a namespace. int and \int always mean the same thing=2C so it seems confusi= ng to allow the latter syntax as if it means something different.=0A= =