Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:106078 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 60065 invoked from network); 26 Jun 2019 23:28:08 -0000 Received: from unknown (HELO lb1-smtp-cloud8.xs4all.net) (194.109.24.21) by pb1.pair.com with SMTP; 26 Jun 2019 23:28:08 -0000 Received: from [IPv6:2001:983:6fc5:1:4053:6cf6:b3fb:1e70] ([IPv6:2001:983:6fc5:1:4053:6cf6:b3fb:1e70]) by smtp-cloud8.xs4all.net with ESMTPA id gEmQh9cBF7KeZgEmShl5lm; Wed, 26 Jun 2019 22:44:37 +0200 To: Arnold Daniels , internals@lists.php.net References: Message-ID: <2c0a414b-859d-3c25-d92a-048c1b8b259f@xs4all.nl> Date: Wed, 26 Jun 2019 22:44:34 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-CMAE-Envelope: MS4wfNWxCj3rdQF4BrA20OMMylWm2FOsjaR4acJhHMYFLvUjCIsvF43+fWq38h9vMcDW7JaOWLnmadCr1aNTBG1d48FWAfrdMIMJE/aVsgBcwkJ5vq8HGwsq qDXvEWr9vvGdpkmHCZOyBHO8Kzn3kHmHhCf9GXoJRBqqYJ5qR7yMUApP1eQaSKfrUuUa7xEkWm0ONTrXUB2bshrgCOeaeyaGAeQmlnn/GM/JJrrS9ceX0Z9j qUx1OsgCR1LhJXB4LoMW087WAQGkn10DvMGsZ+oY4Lr+mMlVSlheQNxbw8m5ZMGauNy88R3gUVqwpaqDtfEJdQ== Subject: Re: [PHP-DEV] [RFC] Strict operators directive From: d.takken@xs4all.nl (Dik Takken) Hello, Thanks a lot for your work on this RFC, it looks like a nice way to allow the language to gradually move forward. As pointed out by others, the ==, ===, != and !== operators are a bit problematic. A possible solution could be to leave them out of the RFC. The reason to do so is that the choice between strict or non-strict comparison is already possible by choosing the appropriate operator. In my view, explicitly using == in stead of === is either intentional or a bug. If it is intentional, the author consciously chose to be non-strict. The strictness declaration would then only affect operators for which no strict variant exists or where the operator is implicit (switch statement). As for changing the behavior of in_array() and friends: I would love the idea of not having to use the strict argument everywhere anymore. However, changing behavior of functions that are not in the same file that has the strictness declaration seems inconsistent. The scope of the declaration would not be well defined anymore. There may be other means to fix this annoyance, like introducing a strict variant of in_array(). Regarding the switch statement: While it is not an operator, one could argue that it is a case of implicit use of an operator. Regards, Dik Takken