Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:75582 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 83293 invoked from network); 16 Jul 2014 09:29:16 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Jul 2014 09:29:16 -0000 Authentication-Results: pb1.pair.com smtp.mail=zeev@zend.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=zeev@zend.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 209.85.220.178 as permitted sender) X-PHP-List-Original-Sender: zeev@zend.com X-Host-Fingerprint: 209.85.220.178 mail-vc0-f178.google.com Received: from [209.85.220.178] ([209.85.220.178:50747] helo=mail-vc0-f178.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 6B/A1-07119-BE546C35 for ; Wed, 16 Jul 2014 05:29:16 -0400 Received: by mail-vc0-f178.google.com with SMTP id la4so1083597vcb.23 for ; Wed, 16 Jul 2014 02:29:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:references:in-reply-to:mime-version :thread-index:date:message-id:subject:to:cc:content-type; bh=6FbpYD86kSWtn8Y0JKTIrYj8bJPSj8n0zRGgKs0n9fE=; b=CE34hXrfVBNZWsPhDm8zQglFo0brbKIIFc79OyaAygeWtuOsBgbYfAJvZT2pj9eTyA 2/SkMF5AHkUAcaQ8j7dL0Bhq8KMuCAtGJJIO5Nx0LaNbzYrpC7P7tLvDDpN4uGFto6uI 24ntFawxVzMm2My6VDr6S5Lkk0bfDmYCGhVcOlfcbuDBEjITvGTwBkDgDgp7r7mzDZAR NTe8wAnEAp3wAJLby+A81YkrtrxbiCAgG7kYsHgv4jkf0lDSPavEZNIXu/X+hQLKHuTB SxFWSv3Ag4DEilZ/OK6TousdhMgpP+NHh66cQqK+i0juDCA2aJ0grBRHCUbWsnIFw7qQ x5EA== X-Gm-Message-State: ALoCoQmdIVN/y9nqQicZ1RDw/QvMVWAfdRl0zMi4vEUNcUAXbvXJDglgMdvxecCHk6vkn/EIJLXT/F3w0HKq8R5w7oK0kPoLh5pT6cX3MSseqYyoeqOJa8wIcu00RxUHIRuMWJ4+sa3O X-Received: by 10.221.34.13 with SMTP id sq13mr27723681vcb.16.1405502953440; Wed, 16 Jul 2014 02:29:13 -0700 (PDT) References: <08503591-EFC8-48E6-984E-FFC292C5EA5F@ajf.me> <16D48604-0C0A-4613-91A4-21392E3A2636@ajf.me> <05CE2216-C5D9-4937-9F2E-AA1407284D9F@ajf.me> <53C460DF.5040304@sugarcrm.com> <53C53A96.2040303@gmail.com> <53C55342.1010207@sugarcrm.com> <53C563B3.6060905@gmail.com> <54536191-1B92-4933-973F-0C8289D13A4C@ajf.me> In-Reply-To: <54536191-1B92-4933-973F-0C8289D13A4C@ajf.me> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQJuUFVOlGiX172RfpkkW7aXwqSXwwLGIEDMAn0sGnoDLh5SUQGHGGlvAc6JkJwCOz0MXAIckqSUAcstGVQBlZLKH5nJEiBA Date: Wed, 16 Jul 2014 12:29:13 +0300 Message-ID: <00d12255efc53466245b21a83ff7d474@mail.gmail.com> To: Andrea Faulds , Andrey Andreev Cc: Rowan Collins , Stas Malyshev , internals@lists.php.net Content-Type: text/plain; charset=UTF-8 Subject: RE: [PHP-DEV] [RFC] Scalar Type Hinting With Casts (re-opening) From: zeev@zend.com (Zeev Suraski) > -----Original Message----- > From: Andrea Faulds [mailto:ajf@ajf.me] > Sent: Tuesday, July 15, 2014 10:48 PM > To: Andrey Andreev > Cc: Rowan Collins; Stas Malyshev; internals@lists.php.net > Subject: Re: [PHP-DEV] [RFC] Scalar Type Hinting With Casts (re-opening) > > > On 15 Jul 2014, at 20:43, Andrey Andreev wrote: > > > I'm sorry, I know what you mean here and I'm not criticizing you > > specifically (in fact, I'm intentionally taking it ouf of context), > > but that's "PHP internals", not "PHP community". > > > > The PHP community that I know, wants to have _both_ type cast hinting > > and strict type declarations. > > I'm not sure that's quite the case. There are camps wanting one, there are > camps wanting the other, I suppose some want both, but to me that seems like > a not-a-compromise compromise solution. The point of this RFC, to some > extent, is to be a reasonable compromise between completely strict > declarations and cast hinting, providing the safety of the first and the flexibility > of the second. I think it strikes the balance well. For me the introduction of a new set of rules is a deal breaker. I'm -1 on the RFC the way it is, and +1 if we implement these 'hints' as implicit casts, plus change implicit casts to emit E_CAST in case of loss of data or 'bogus' conversions. Why insist E_RECOVERABLE_ERROR and introduce this effectively new set of rules, instead of switching to E_CAST and maintain consistency? Maintaining consistency is a HUGE deal. Every such feature we add that you need to learn more rules/exceptions for make PHP harder to learn. Zeev