Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:60516 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 45196 invoked from network); 8 May 2012 02:06:02 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 8 May 2012 02:06:02 -0000 Authentication-Results: pb1.pair.com smtp.mail=shadda@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=shadda@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.210.42 as permitted sender) X-PHP-List-Original-Sender: shadda@gmail.com X-Host-Fingerprint: 209.85.210.42 mail-pz0-f42.google.com Received: from [209.85.210.42] ([209.85.210.42:57872] helo=mail-pz0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F6/91-30976-98F78AF4 for ; Mon, 07 May 2012 22:06:01 -0400 Received: by dalf4 with SMTP id f4so5758909dal.29 for ; Mon, 07 May 2012 19:05:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; bh=YSwjP2RaM1d0x5Nfvaal4hEx2qqyjQnpnJHAfR8b4s8=; b=FzLX4p2mrlYKUaVN0j8ao0iaV0hxMDsSC89m9gcQcJGqiPI1dtE4DJqMZZ5RViYtIs nUxG28MM3UvYFEtb7AeAKY7qB6Lysy1IC7DN3Q5JkS7Lg+uSkNMaQYTLyhH+ID2+PE2R WxurA4N4cxWcINzP0HzmETw46YIEPE/H+RHzMQT47gxY78UqtxYxrVnBYTQvRbLQ8qqw y6MxNcafn7EQQjB5OK3cTx49I1wY99QF0zqVjRaCUatSAqzqHg9DyhjQECmzeaUhYEaP U0YjzHnZkst+lyW8N1m2YzcvWJxJBPewoMjPpf0bKeZ3Hbmleqpvuy9L56i9DXvPJc4C R/eg== Received: by 10.68.216.98 with SMTP id op2mr919812pbc.93.1336442758790; Mon, 07 May 2012 19:05:58 -0700 (PDT) Received: from [192.168.1.101] (c-50-131-57-142.hsd1.ca.comcast.net. [50.131.57.142]) by mx.google.com with ESMTPS id wn3sm618091pbc.74.2012.05.07.19.05.56 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 07 May 2012 19:05:57 -0700 (PDT) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii In-Reply-To: Date: Mon, 7 May 2012 19:05:55 -0700 Cc: internals@lists.php.net Content-Transfer-Encoding: quoted-printable Message-ID: References: <4F847B8A.9010007@sugarcrm.com> <733bc8ea59cf6737563a62886e92fcb6.squirrel@www.l-i-e.com> <4FA7C229.9080901@gmail.com> To: Raymond Irving X-Mailer: Apple Mail (2.1084) Subject: Re: [PHP-DEV] [off] PHP: a fractal of bad design From: shadda@gmail.com (Matt Wilson) While it's not the prettiest of side effects in php, I don't agree it = should be "fixed" On top of a massive BC break, it's not as if the results are = inconsistent. Learning php means learning how type juggling works.=20 At most, I'd remove the part that truncates numeric strings like = "123abc" and always convert them to 0, because that's almost *never* an = intended effect. One could argue that "123" =3D=3D 123 is, however. On May 7, 2012, at 6:25 PM, Raymond Irving wrote: > I was very surprised when I came across the =3D=3D issue sometime ago. = IMO > strings should be compared as strings. They should never be converted = to > integer. >=20 >=20 > 1=3D=3D"1" // always convert the number value to a string and = then > compare it > "foo" =3D=3D 0 // should return false >=20 > "123abc" =3D=3D "123nth" // compare as string. Do not convert to = numeric values >=20 > "0"=3D=3D0 // true > 0=3D=3D"0." // false >=20 > PHP is great but if we can work together to remove the flaws, then we = can > make it even greater. We have to leave the past behind us and look at = where > we want PHP to be in the next 5 years >=20 >=20 > Best regards,