Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:58336 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 22214 invoked from network); 29 Feb 2012 15:27:28 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 29 Feb 2012 15:27:28 -0000 Authentication-Results: pb1.pair.com smtp.mail=linepogl@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=linepogl@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.160.170 as permitted sender) X-PHP-List-Original-Sender: linepogl@gmail.com X-Host-Fingerprint: 209.85.160.170 mail-gy0-f170.google.com Received: from [209.85.160.170] ([209.85.160.170:42325] helo=mail-gy0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 82/24-33921-0E34E4F4 for ; Wed, 29 Feb 2012 10:27:28 -0500 Received: by ghbg2 with SMTP id g2so2790373ghb.29 for ; Wed, 29 Feb 2012 07:27:25 -0800 (PST) Received-SPF: pass (google.com: domain of linepogl@gmail.com designates 10.236.154.168 as permitted sender) client-ip=10.236.154.168; Authentication-Results: mr.google.com; spf=pass (google.com: domain of linepogl@gmail.com designates 10.236.154.168 as permitted sender) smtp.mail=linepogl@gmail.com; dkim=pass header.i=linepogl@gmail.com Received: from mr.google.com ([10.236.154.168]) by 10.236.154.168 with SMTP id h28mr1090353yhk.59.1330529245374 (num_hops = 1); Wed, 29 Feb 2012 07:27: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:from:date:message-id:subject:to :cc:content-type; bh=dM/qHG1KHt4H/OkBGxCpVEgiqO5znox8QMOT0DXIGHM=; b=G1K9TrFcZkKZZgOlO/GIcEdz00IJZEPwOGVwV+of6ovMpV3y0qpH+OJId6AnK8Df4M XhuSlUhDsHQazW3+u1Xaveg2WoCXEZ70pow5m8CB/fnDcuQ3RFf1Ig/m9MVZl21X0YJZ Na+bEslQ8VqWg0UoBczdOdh17iOWTLfqX5Nrw= Received: by 10.236.154.168 with SMTP id h28mr872254yhk.59.1330529245317; Wed, 29 Feb 2012 07:27:25 -0800 (PST) MIME-Version: 1.0 Received: by 10.147.125.8 with HTTP; Wed, 29 Feb 2012 07:27:04 -0800 (PST) In-Reply-To: References: <1330357150.2159.30.camel@guybrush> <693e15008681dfe7372eaea66214f8a8.squirrel@www.l-i-e.com> <4F4D5D44.5090307@developersdesk.com> Date: Wed, 29 Feb 2012 16:27:04 +0100 Message-ID: To: Michael Morris Cc: internals@lists.php.net Content-Type: multipart/alternative; boundary=20cf3040eb9a07c99604ba1bfbcd Subject: Re: [PHP-DEV] Scalar type hinting From: linepogl@gmail.com (Lazare Inepologlou) --20cf3040eb9a07c99604ba1bfbcd Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable > int $a =3D "1"; // no error. 1 =3D=3D "1" so who cares? > int $a =3D 'House'; // error 0 !=3D 'House', so this is a problem. For the sake of consistency, please take into account this example, which works in the current implementation of PHP: $b =3D 1 + "1"; // no error, $b =3D=3D 2 $b =3D 1 + "House"; // no error, $b =3D=3D 1 So, I believe that, raising an error or not, is not a question of the new RFC. Should there be an error, then it has to be in every unsuccessful type juggling, regardless of the final assignment to a type-locked variable. Lazare INEPOLOGLOU Ing=C3=A9nieur Logiciel 2012/2/29 Michael Morris > Agreed. If conversion can occur without data loss (that is, if the > value being assigned is =3D=3D the value that actually IS assigned) then > no error should occur. > > So > > int $a =3D "1"; // no error. 1 =3D=3D "1" so who cares? > int $a =3D 'House'; // error 0 !=3D 'House', so this is a problem. > > Again, errors should only raise if the final value !=3D source value. > > On Tue, Feb 28, 2012 at 6:03 PM, Rick WIdmer > wrote: > > On 2/28/2012 2:58 PM, Kris Craig wrote: > > > >> strong int $a =3D "1"; // Converts to 1. May or may not throw an erro= r > (I'm > >> still on the fence). > > > > > > It this is an error, it is no longer PHP. > > > > > > -- > > PHP Internals - PHP Runtime Development Mailing List > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --20cf3040eb9a07c99604ba1bfbcd--