Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:58380 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 38803 invoked from network); 1 Mar 2012 01:56:19 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 1 Mar 2012 01:56:19 -0000 Authentication-Results: pb1.pair.com smtp.mail=adamjonr@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=adamjonr@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.214.170 as permitted sender) X-PHP-List-Original-Sender: adamjonr@gmail.com X-Host-Fingerprint: 209.85.214.170 mail-tul01m020-f170.google.com Received: from [209.85.214.170] ([209.85.214.170:49453] helo=mail-tul01m020-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 88/D2-46815-247DE4F4 for ; Wed, 29 Feb 2012 20:56:19 -0500 Received: by obbwd1 with SMTP id wd1so124246obb.29 for ; Wed, 29 Feb 2012 17:56:16 -0800 (PST) Received-SPF: pass (google.com: domain of adamjonr@gmail.com designates 10.182.231.100 as permitted sender) client-ip=10.182.231.100; Authentication-Results: mr.google.com; spf=pass (google.com: domain of adamjonr@gmail.com designates 10.182.231.100 as permitted sender) smtp.mail=adamjonr@gmail.com; dkim=pass header.i=adamjonr@gmail.com Received: from mr.google.com ([10.182.231.100]) by 10.182.231.100 with SMTP id tf4mr1096186obc.56.1330566976153 (num_hops = 1); Wed, 29 Feb 2012 17:56:16 -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 :content-type; bh=BIw3N6NqO59+NfMTJJToLRl22TweNsc02P5Jf6mz5DE=; b=q/H3p+NdaNpXEpguUEMxvRhrDs+1tB1VvlY3zV+ysP4xmTW1wY8DsKVKDNVrPOl9Vx u6SFY6Zdvd9esOlEpSjnUW0P5gU4MDodGi78K+7+kAb1NTIBaQ+VjDQTBRg0CGkcQwwO d0MajRCd0IfbUSET9BXUmu1cfvhAeo4XrwcBc= MIME-Version: 1.0 Received: by 10.182.231.100 with SMTP id tf4mr953863obc.56.1330566976111; Wed, 29 Feb 2012 17:56:16 -0800 (PST) Received: by 10.182.19.104 with HTTP; Wed, 29 Feb 2012 17:56:16 -0800 (PST) In-Reply-To: References: <693e15008681dfe7372eaea66214f8a8.squirrel@www.l-i-e.com> <4F4D5D44.5090307@developersdesk.com> Date: Wed, 29 Feb 2012 20:56:16 -0500 Message-ID: To: internals@lists.php.net Content-Type: multipart/alternative; boundary=f46d04479615f6042004ba24c3cf Subject: Re: [PHP-DEV] Scalar type hinting From: adamjonr@gmail.com (Adam Jon Richardson) --f46d04479615f6042004ba24c3cf Content-Type: text/plain; charset=ISO-8859-1 On Wed, Feb 29, 2012 at 8:46 PM, Kris Craig wrote: > 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. > > > John raises some real concerns about the relation of hinting and juggling. I'm wondering about allowing developers to declare type intentions (I'll post an idea in a separate thread.) Adam --f46d04479615f6042004ba24c3cf--