Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:89388 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 26525 invoked from network); 24 Nov 2015 17:16:29 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Nov 2015 17:16:29 -0000 X-Host-Fingerprint: 178.62.40.5 ajf.me Received: from [178.62.40.5] ([178.62.40.5:19767] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 84/DA-57156-C6B94565 for ; Tue, 24 Nov 2015 12:16:29 -0500 Message-ID: <84.DA.57156.C6B94565@pb1.pair.com> To: internals@lists.php.net References: <56547DFE.3080407@php.net> <565496FA.2010604@gmail.com> Date: Tue, 24 Nov 2015 17:16:22 +0000 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:42.0) Gecko/20100101 Firefox/42.0 SeaMonkey/2.39 MIME-Version: 1.0 In-Reply-To: <565496FA.2010604@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Posted-By: 178.62.40.5 Subject: Re: [PHP-DEV] Re: Scalar Type Declaration Syntax Weirdness From: ajf@ajf.me (Andrea Faulds) 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/