Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:89390 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 29798 invoked from network); 24 Nov 2015 17:29:25 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Nov 2015 17:29:25 -0000 Authentication-Results: pb1.pair.com header.from=t.carnage@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=t.carnage@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.48 as permitted sender) X-PHP-List-Original-Sender: t.carnage@gmail.com X-Host-Fingerprint: 74.125.82.48 mail-wm0-f48.google.com Received: from [74.125.82.48] ([74.125.82.48:34986] helo=mail-wm0-f48.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id CC/8B-57156-57E94565 for ; Tue, 24 Nov 2015 12:29:25 -0500 Received: by wmuu63 with SMTP id u63so106318024wmu.0 for ; Tue, 24 Nov 2015 09:29:22 -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=JCyoANB3YxhadizRtHnUIWxsSO+ZC+pE+EY9gpXX5Hc=; b=dJ7SGHqMiTlgyRQyp3wPQjFFYZlSK0I6DtjCbTsIvyBaeRsrNb92O1YvrqrtCOUty7 aa5XQurrIS0RYHZLV7uXHRGXEYGLecV0qSTDvJbs5wacflGpRaDCCJ4gKxHezg/PUy5m vqoyd0yt9mpmzkFj7OaNDmMIJMS9Uu5uT+uPcHwBUWd+2lZLRKiUHi+IW6GeUCgHyvo0 sxqiIEdUyFYa6rVhgYZgiHRc45cA45mAi1Dv20JL7NQNjNB9NY6u8REjJ5x6n7sRfGjy 7Qfx1jDfWC/0rgi96bFIM29atIvbvmMpbLRn90ZyJht8dAL9WfQRQZe/y0OHq9TiAdTL yMrg== MIME-Version: 1.0 X-Received: by 10.194.109.2 with SMTP id ho2mr43318973wjb.40.1448386162698; Tue, 24 Nov 2015 09:29:22 -0800 (PST) Received: by 10.194.115.67 with HTTP; Tue, 24 Nov 2015 09:29:22 -0800 (PST) In-Reply-To: <84.DA.57156.C6B94565@pb1.pair.com> References: <56547DFE.3080407@php.net> <565496FA.2010604@gmail.com> <84.DA.57156.C6B94565@pb1.pair.com> Date: Tue, 24 Nov 2015 17:29:22 +0000 Message-ID: To: Andrea Faulds Cc: PHP internals Content-Type: multipart/alternative; boundary=089e010d84e8b9b0cd05254cae38 Subject: Re: [PHP-DEV] Re: Scalar Type Declaration Syntax Weirdness From: t.carnage@gmail.com (Chris Riley) --089e010d84e8b9b0cd05254cae38 Content-Type: text/plain; charset=UTF-8 On 24 November 2015 at 17:16, Andrea Faulds wrote: > Hi Stas, > > Stanislav Malyshev wrote: > >> Hi! >> >> >>> function a(\int $i) {} >>>> >>>> Is it intentional that the \ in front of the "int" is allowed? IMHO, >>>> this >>>> confusing notation must not be allowed. >>>> >>> >>> This is weird and I'd consider it a bug. You can't do \array or >>> \callable, and if I saw \int, I'd think it meant a class of that name >>> rather than a scalar type. >>> >> >> I would assume \int means class named "int", as opposed to "int" type. >> > > That's also what I'd expect. However, "int" is not allowed as a class name > in PHP 7. And unfortunately what the code Sebastian posted sctually does is > act as an integer type hint, not as a class type hint. > > Can this be fixed for 7.0.0? >>> >> >> I don't think this would be a good idea. We're in the final stretch of >> release cycle, and should not do any non-urgent fixes. This does not >> look urgent. It can wait for 7.0.1. >> > > It can't wait for 7.0.1, because banning this would be a > backwards-compatibility break with 7.0.0. We have to fix it in 7.0.0 or not > fix it ever. > > Thanks. > > -- > Andrea Faulds > http://ajf.me/ > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > Could we not just document it as \int is not allowed and throws a fatal error. Then we'd just be fixing a bug in documented behaviour. ~C --089e010d84e8b9b0cd05254cae38--