Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:58316 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 35500 invoked from network); 29 Feb 2012 01:40:13 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 29 Feb 2012 01:40:13 -0000 Authentication-Results: pb1.pair.com header.from=kris.craig@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=kris.craig@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.54 as permitted sender) X-PHP-List-Original-Sender: kris.craig@gmail.com X-Host-Fingerprint: 74.125.82.54 mail-ww0-f54.google.com Received: from [74.125.82.54] ([74.125.82.54:37546] helo=mail-ww0-f54.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 4C/F4-36673-CF18D4F4 for ; Tue, 28 Feb 2012 20:40:12 -0500 Received: by wgbdq13 with SMTP id dq13so1690404wgb.11 for ; Tue, 28 Feb 2012 17:40:09 -0800 (PST) Received-SPF: pass (google.com: domain of kris.craig@gmail.com designates 10.180.24.4 as permitted sender) client-ip=10.180.24.4; Authentication-Results: mr.google.com; spf=pass (google.com: domain of kris.craig@gmail.com designates 10.180.24.4 as permitted sender) smtp.mail=kris.craig@gmail.com; dkim=pass header.i=kris.craig@gmail.com Received: from mr.google.com ([10.180.24.4]) by 10.180.24.4 with SMTP id q4mr12682547wif.7.1330479609685 (num_hops = 1); Tue, 28 Feb 2012 17:40:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=6jAuZ0FdaSLmKUqGok+BSYlnGsyQcqm2WuwL9xD80Ms=; b=DJraQBI17fz6MaSVjJKy4f2T0H9EFjAFsASN9w/ZbdhOt/ol3q9O7WEKYp37uimhwq SbZmOGO1Li+LOQ4comwVQhwtojpYvqBs+E1TQ9Gas5kpk6sFOKXWMy8rIIJRcRplwnyE KIYq+0lqEdMK/I14Lqrxcv/bseecA32/b1Ec4= MIME-Version: 1.0 Received: by 10.180.24.4 with SMTP id q4mr10114831wif.7.1330479609639; Tue, 28 Feb 2012 17:40:09 -0800 (PST) Received: by 10.223.75.146 with HTTP; Tue, 28 Feb 2012 17:40:09 -0800 (PST) In-Reply-To: References: <1330357150.2159.30.camel@guybrush> <693e15008681dfe7372eaea66214f8a8.squirrel@www.l-i-e.com> <4F4D5D44.5090307@developersdesk.com> Date: Tue, 28 Feb 2012 17:40:09 -0800 Message-ID: To: John Crenshaw Cc: Rick WIdmer , "internals@lists.php.net" Content-Type: multipart/alternative; boundary=f46d043be1c68372af04ba106cf5 Subject: Re: [PHP-DEV] Scalar type hinting From: kris.craig@gmail.com (Kris Craig) --f46d043be1c68372af04ba106cf5 Content-Type: text/plain; charset=ISO-8859-1 I wouldn't mind that, though I'm concerned that it may not be sellable because some people on here have expressed a strong opinion that this shouldn't throw anything more than a notice or a warning at most, something that I and others strongly disagree with. The logical approach, to me at least, is to follow the example of include() and require(); i.e. they're both identical except that one throws a scary error while the other one is just a warning. I'm fine with just throwing E_RECOVERABLE_ERROR, though I fear that may alienate too many people for us to be able to get this through. Though it's possible I might be overestimating that factor. --Kris On Tue, Feb 28, 2012 at 5:17 PM, John Crenshaw wrote: > > On Tue, Feb 28, 2012 at 3:03 PM, Rick WIdmer >wrote: > > > > > On 2/28/2012 2:58 PM, Kris Craig wrote: > > > > > > strong int $a = "1"; // Converts to 1. May or may not throw an error > > > (I'm > > >> still on the fence). > > >> > > > > > > It this is an error, it is no longer PHP. > > > > > > > @Rick Though I'm not sure I'd agree with the overly broad "it is no > longer PHP" hyperbole, I think the basic point that it would be a > significant departure from the current model has merit. So ok, you've > convinced me. > That example should not throw any errors. I'm officially no longer on the > fence with that. =) > > > > --Kris > > OK, if we're all on the same page there, I think this means that there is > no significant difference between the "strong int" and "weak int" in your > proposal (the only remaining difference being the level of error raised > when it cannot be converted, which IMO is not substantial enough to deserve > a keyword.) I'd prefer to just pick one error level to use > (E_RECOVERABLE_ERROR would be the most consistent) and keep everything > simple. > > John Crenshaw > Priacta, Inc. > --f46d043be1c68372af04ba106cf5--