Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:89376 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 4300 invoked from network); 24 Nov 2015 15:27:38 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Nov 2015 15:27:38 -0000 Authentication-Results: pb1.pair.com header.from=derokorian@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=derokorian@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.49 as permitted sender) X-PHP-List-Original-Sender: derokorian@gmail.com X-Host-Fingerprint: 74.125.82.49 mail-wm0-f49.google.com Received: from [74.125.82.49] ([74.125.82.49:38769] helo=mail-wm0-f49.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 35/96-57156-9E184565 for ; Tue, 24 Nov 2015 10:27:38 -0500 Received: by wmec201 with SMTP id c201so31654343wme.1 for ; Tue, 24 Nov 2015 07:27:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=7nEZrH4Oj+L+UPFJBhUVF/EIs/pWg3XJYpLipkp28sI=; b=kwpAG6hrzDUSVwSZq+RVXo8IShZ5W6lKU+ZKew6aMTA1QfgJ9wGAivjPPBhpoP5z0K hj80hbVO8XIj2gCvm8lcfzU0Ivz9529lQFCQH+YXl8CXwYr+6n+7j3/Fbw/LCarDMoiF M7ixe21tCudQKUsSwnUexPda2ixzShvjqJziueibyPc5NL9rD0CNvVrUQYRsgtM553QT 3YssrhMKxIPHtdiJjEs2i8W/gmfi3lTiX34eAjc/TYjb0S1LCJSZNOE3lDzg17mgcDdw rT3HrcrtUHXVzDmRQBQodzLJBBsNaGfVG36e/KdT97pNkcpBZl5pxqTMGpYJ3RtSSYxe oZNQ== MIME-Version: 1.0 X-Received: by 10.194.222.229 with SMTP id qp5mr16744834wjc.85.1448378854431; Tue, 24 Nov 2015 07:27:34 -0800 (PST) Received: by 10.28.98.87 with HTTP; Tue, 24 Nov 2015 07:27:34 -0800 (PST) In-Reply-To: <56547DFE.3080407@php.net> References: <56547DFE.3080407@php.net> Date: Tue, 24 Nov 2015 08:27:34 -0700 Message-ID: To: Sebastian Bergmann Cc: "internals@lists.php.net" Content-Type: multipart/alternative; boundary=001a11c3ab6e1e646005254afb84 Subject: Re: [PHP-DEV] Scalar Type Declaration Syntax Weirdness From: derokorian@gmail.com (Ryan Pallas) --001a11c3ab6e1e646005254afb84 Content-Type: text/plain; charset=UTF-8 On Tue, Nov 24, 2015 at 8:10 AM, Sebastian Bergmann wrote: > The following is currently valid PHP 7 code > > function a(\int $i) {} > > Is it intentional that the \ in front of the "int" is allowed? IMHO, this > confusing notation must not be allowed. > > > Why not? Its a root level type, you can prefix a \ on any other root level type that's valid for use in type hinting. function a(\DateTime $d) {} function b(\SplFileObject $f) {} Also, this is the only way to get some IDEs to recognize the type when in a namespace (at least currently). --001a11c3ab6e1e646005254afb84--