Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:76659 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 70701 invoked from network); 18 Aug 2014 15:09:21 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Aug 2014 15:09:21 -0000 Authentication-Results: pb1.pair.com smtp.mail=tjerk.meesters@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=tjerk.meesters@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.192.174 as permitted sender) X-PHP-List-Original-Sender: tjerk.meesters@gmail.com X-Host-Fingerprint: 209.85.192.174 mail-pd0-f174.google.com Received: from [209.85.192.174] ([209.85.192.174:61474] helo=mail-pd0-f174.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A5/92-54989-F1712F35 for ; Mon, 18 Aug 2014 11:09:20 -0400 Received: by mail-pd0-f174.google.com with SMTP id fp1so7713474pdb.33 for ; Mon, 18 Aug 2014 08:09:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=references:mime-version:in-reply-to:content-type :content-transfer-encoding:message-id:cc:from:subject:date:to; bh=0mE5CQ4Q9PUf8buNGytpuB8RXs/fMeAJA/evh+kkM3E=; b=rWrc56pbQ5jSlDXXcGzdOeIG+y/7DqlAgbTRLSFs7kBSqFjVc0n/68FVW0FnBGWPRx ewrISKTO+5uoF1DMWeqAUTQWyjVIQj1BHnvRhIPvSekxdX+1SW+b4J3g3dX1vf8thODu SMfgq2Lwtewa5a3raOISgZQ8+aR0rknH/4db1A185umbYyF8+CA9XnmWfCpaLEilbQoj eNKZ9vNWg3mfKGACRnyH/kQVWHeRdfDx8TB98+JcGxqWX17AxZCtlhBuK7BE7gNNw8k7 xa9xi9KXprX5fM337FWnegcmWjCXqequ4gCJMt82fbbpe0aRX47lZbOaAZ45F4lmpmmo iqiQ== X-Received: by 10.68.68.131 with SMTP id w3mr35961517pbt.90.1408374551868; Mon, 18 Aug 2014 08:09:11 -0700 (PDT) Received: from [192.168.1.104] (bb121-7-198-24.singnet.com.sg. [121.7.198.24]) by mx.google.com with ESMTPSA id ng15sm25154574pdb.87.2014.08.18.08.09.09 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 18 Aug 2014 08:09:10 -0700 (PDT) References: <53F1094B.4040100@mabe.berlin> <53F1F534.50109@mabe.berlin> <1408373244.2617.344.camel@guybrush> Mime-Version: 1.0 (1.0) In-Reply-To: <1408373244.2617.344.camel@guybrush> Content-Type: text/plain; charset=gb2312 Content-Transfer-Encoding: quoted-printable Message-ID: <37CD1B56-B84F-4586-A631-F3C7F2547FBE@gmail.com> Cc: Marc Bennewitz , Sara Golemon , PHP internals X-Mailer: iPhone Mail (11D257) Date: Mon, 18 Aug 2014 23:09:02 +0800 To: =?GB2312?Q?Johannes_Schl=A8=B9ter?= Subject: Re: [PHP-DEV] [RFC] Binary String Comparison From: tjerk.meesters@gmail.com (Tjerk Meesters) > On 18 Aug, 2014, at 10:47 pm, Johannes Schl=A8=B9ter wrote: >=20 >> On Mon, 2014-08-18 at 14:44 +0200, Marc Bennewitz wrote: >> The question isn't "What's wrong with =3D=3D=3D, strcmp()?" but "What's w= rong=20 >> with =3D=3D, <, >?". >>=20 >> We have a standard way to compare two operands but currently we do some=20= >> magic things to solve something that don't need to be solved. >=20 > Still it is a key property of the language which we can't simply change. > Also mind this: All input data are strings and some databases also > return data as string. So code like >=20 > if ($_GET['id'] > 0) > or > if ($db->fetchRow()[0] =3D=3D 12) >=20 > which is common will break. Those two cases will actually not be affected, it's strictly string<=3D>stri= ng comparisons that's being discussed here.=20 > Maybe using different sets of operators > would have been better, but that should have happened 20 years ago not > now. >=20 > Also mind consistency: If you change this you probably also have to > change other places where implicit conversion happens, i.e. array keys.=20= >=20 > In the end you get a complete new incompatible language and can throw > away most libraries and so on.=20 >=20 > So in case you have a Tardis, DeLorean with Flux Capacitor or any other > time machine I'm happy to support you in the past, but not this late. >=20 > johannes >=20 >=20 > --=20 > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php >=20