Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:58398 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 96871 invoked from network); 1 Mar 2012 09:10:25 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 1 Mar 2012 09:10:25 -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.161.170 as permitted sender) X-PHP-List-Original-Sender: linepogl@gmail.com X-Host-Fingerprint: 209.85.161.170 mail-gx0-f170.google.com Received: from [209.85.161.170] ([209.85.161.170:45705] helo=mail-gx0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 9F/5E-46815-00D3F4F4 for ; Thu, 01 Mar 2012 04:10:25 -0500 Received: by ggki2 with SMTP id i2so117756ggk.29 for ; Thu, 01 Mar 2012 01:10:22 -0800 (PST) Received-SPF: pass (google.com: domain of linepogl@gmail.com designates 10.236.177.6 as permitted sender) client-ip=10.236.177.6; Authentication-Results: mr.google.com; spf=pass (google.com: domain of linepogl@gmail.com designates 10.236.177.6 as permitted sender) smtp.mail=linepogl@gmail.com; dkim=pass header.i=linepogl@gmail.com Received: from mr.google.com ([10.236.177.6]) by 10.236.177.6 with SMTP id c6mr5705502yhm.42.1330593022457 (num_hops = 1); Thu, 01 Mar 2012 01:10:22 -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=BFHmQ0HrKJQFI5u4EsmqCgS0DkADTOFZEhJ3/k44kio=; b=R623sc3eKCRoZYGVF0kraCsztmRHHsMUt3jkh56f6NXffTQDjWC4ga7l8/bQYMSog8 PBTp3Nx/CKIun4ngb0aLWpmtCvHthhBbTXPa5k92aV54nDcGzTBdyuPSpFx2CwC+xrQ4 2EoUBbiBXCL3yEXnUmCrQxtkAY7slBY0rwGnc= Received: by 10.236.177.6 with SMTP id c6mr4428949yhm.42.1330593022388; Thu, 01 Mar 2012 01:10:22 -0800 (PST) MIME-Version: 1.0 Received: by 10.147.125.8 with HTTP; Thu, 1 Mar 2012 01:10:02 -0800 (PST) In-Reply-To: References: <693e15008681dfe7372eaea66214f8a8.squirrel@www.l-i-e.com> <4F4D5D44.5090307@developersdesk.com> Date: Thu, 1 Mar 2012 10:10:02 +0100 Message-ID: To: John Crenshaw Cc: "internals@lists.php.net" Content-Type: multipart/alternative; boundary=20cf3056390170aba504ba2ad4cb Subject: Re: [PHP-DEV] PHP Philosophy (was RE: [PHP-DEV] Scalar type hinting) From: linepogl@gmail.com (Lazare Inepologlou) --20cf3056390170aba504ba2ad4cb Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable > That's what I was calling "inconsistent", specifically because (int)'foo' > =3D=3D 0 with no warning whatsoever, but int $a =3D 'foo' would be 0 with= an > error of some sort. Behavior with respect to when an error is raised is > inconsistent. In both cases there is a very lossy conversion, why is ther= e > an error in one case and not the other? Inconsistent. > +1 However, I would love to have int $a =3D 'foo' cast to 0 without any error. New functionality without breaking BC. Lazare INEPOLOGLOU Ing=C3=A9nieur Logiciel 2012/3/1 John Crenshaw > From: Simon Schick [mailto:simonsimcity@googlemail.com] > > > > Hi, John > > > > Just to add an idea to yours .. > > > > Do you think it's a compatibility-break if we'd decide to send a > E_NOTICE or E_WARNING if we f.e. try to give a string to a method that ju= st > allows integer for this argument? > No break at all, just a E_NOTICE or E_WARNING as the script can succeed > anyways. > > > > Bye > > Simon > > That's what I was calling "inconsistent", specifically because (int)'foo' > =3D=3D 0 with no warning whatsoever, but int $a =3D 'foo' would be 0 with= an > error of some sort. Behavior with respect to when an error is raised is > inconsistent. In both cases there is a very lossy conversion, why is ther= e > an error in one case and not the other? Inconsistent. > > On the other hand if you add an error in the legacy case now that's a BC > break. One might argue that it should always have given a notice, but it > didn't, so it's a change, and a BC break. Pick your poison. > > John Crenshaw > Priacta, Inc. > --20cf3056390170aba504ba2ad4cb--