Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:58379 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 37326 invoked from network); 1 Mar 2012 01:46:28 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 1 Mar 2012 01:46:28 -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.170 as permitted sender) X-PHP-List-Original-Sender: kris.craig@gmail.com X-Host-Fingerprint: 74.125.82.170 mail-we0-f170.google.com Received: from [74.125.82.170] ([74.125.82.170:64484] helo=mail-we0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B4/82-46815-4F4DE4F4 for ; Wed, 29 Feb 2012 20:46:28 -0500 Received: by werh12 with SMTP id h12so47752wer.29 for ; Wed, 29 Feb 2012 17:46:25 -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 q4mr22424912wif.7.1330566385624 (num_hops = 1); Wed, 29 Feb 2012 17:46:25 -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=vhkCrny0rBTe40PD+nuwykxaOxCW55w2sqcWZUsKrMU=; b=oIqhzNxh2dhCT5keRB7vwuBXq9l4/vuj0U/fIXV9nLyVuLPmaVCV7cSeCIhsjaVqRT 7WQm/g20Bz34hdz9FcdHlHGVsi8+y1b3a5xOoYenJozWGg1iIXOh+Fa5xFIW9gWUgSYU S5k/PtR47gZPqbs5AL/0DSkcv2lFSUaQBlU9E= MIME-Version: 1.0 Received: by 10.180.24.4 with SMTP id q4mr17887693wif.7.1330566385546; Wed, 29 Feb 2012 17:46:25 -0800 (PST) Received: by 10.223.75.146 with HTTP; Wed, 29 Feb 2012 17:46:25 -0800 (PST) In-Reply-To: References: <693e15008681dfe7372eaea66214f8a8.squirrel@www.l-i-e.com> <4F4D5D44.5090307@developersdesk.com> Date: Wed, 29 Feb 2012 17:46:25 -0800 Message-ID: To: John Crenshaw Cc: Richard Lynch , "internals@lists.php.net" Content-Type: multipart/alternative; boundary=f46d043be1c6c2b73d04ba24a080 Subject: Re: [PHP-DEV] Scalar type hinting From: kris.craig@gmail.com (Kris Craig) --f46d043be1c6c2b73d04ba24a080 Content-Type: text/plain; charset=ISO-8859-1 I was thinking something more along the lines of simply throwing an error if, say, (int) $a != $a.... *if *$a is defined as an integer. --Kris On Wed, Feb 29, 2012 at 5:16 PM, John Crenshaw wrote: > > -----Original Message----- > > From: Kris Craig [mailto:kris.craig@gmail.com] > > > > @Richard I think you made a very good point. Should we treat a float => > int mismatch the same as we would a string => int mismatch, or should the > former fail more gracefully? I can see good arguments for both. > > > > --Kris > > I'm beginning to think that the type hinting question is too closely > related to the dirty secrets of type juggling to resolve them separately. > You may have to either discard consistency, or else fix the problem of > silent bizarre conversions at the same time ('foo'==0, '123abc'=123). > Fixing the conversions is a BC break though. > > John Crenshaw > Priacta, Inc. > --f46d043be1c6c2b73d04ba24a080--