Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:106068 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 32692 invoked from network); 26 Jun 2019 12:05:44 -0000 Received: from unknown (HELO mail.gna.ch) (62.12.172.119) by pb1.pair.com with SMTP; 26 Jun 2019 12:05:44 -0000 Received: from [10.0.1.55] (77-56-180-37.dclient.hispeed.ch [77.56.180.37]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by darkcity.gna.ch (Postfix) with ESMTPSA id A11D321052; Wed, 26 Jun 2019 11:22:05 +0200 (CEST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) In-Reply-To: Date: Wed, 26 Jun 2019 11:22:05 +0200 Cc: PHP Internals Content-Transfer-Encoding: quoted-printable Message-ID: References: <6D1026FF-ECF1-4604-91A8-D290D37CC238@cschneid.com> To: Benjamin Morel X-Mailer: Apple Mail (2.3445.104.11) Subject: Re: [PHP-DEV] [RFC] Strict operators directive From: cschneid@cschneid.com (Christian Schneider) Am 26.06.2019 um 11:09 schrieb Benjamin Morel = : >=20 >> "120" > "99.9"; // TypeError >> Anything else will bring confusion. >=20 > Not sure about this, you can do it the JS way: if both operands are > strings, then it behaves like strcmp(): >=20 > "23" > "4"; // false > "23" > "221"; // true >=20 > I'm not saying that we should do it, but this would not be confusing = to me > at all. With the proposed change both "23" > "4" =3D=3D=3D true # Current behaviour and "23" > "4" =3D=3D=3D false # New strict behaviour could be the case depending on a declaration somewhere else in the = source code. That's the confusion Claude and I were talking about: You cannot be sure = what a very simple line of code does. - Chris