Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:106080 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 68858 invoked from network); 27 Jun 2019 00:06:27 -0000 Received: from unknown (HELO mail-oi1-f176.google.com) (209.85.167.176) by pb1.pair.com with SMTP; 27 Jun 2019 00:06:27 -0000 Received: by mail-oi1-f176.google.com with SMTP id s184so234212oie.9 for ; Wed, 26 Jun 2019 14:22:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=djlA/fZnRyjAV+JWF0Ah9iNcDzUcsXwWihV576cULac=; b=YdcAlot3RhujVD03iUkFqRkqtEGxIbrF3SNBnwgwJX2tlW51LKdBoDJ6yEUmqkccQD Cw3iuLmp/+sDLDVecM4t7e6A09mcSU8Vw26VQTGTM0P/OaJbZk619u6W/sR4z/fmj40Z mN+P91TguBk+SkVciyA3uEIoFCp8uuVj80jAnNOyE6uLAEZ8SBkNUoOWrRZYzFJkDPLF ufpFZVdGM+K5MGWDxo/asWoXqEa0DN/AFZ7LKqELa35ipc1KeFNSTKlA3FI5cq0tfuYr XrBjqb0boiITL5UUcZuvPVVeQlpVpnepcnwa3nnI5SrWrbghhwx6dt0/Hj7EvcfANCdP afLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=djlA/fZnRyjAV+JWF0Ah9iNcDzUcsXwWihV576cULac=; b=KzsWla8cwA7e2DvHBWLuQjAqSkCm0cqUpqpyLPUtVUHArUZLXq4PXVMpX2jaXRQg9M Ve1KAXfV8pOSahM+JE5fOMAizpbTRYGbTMAO7j7GkVXGFLPtPHYaEl2Fz+CA+G7VFsBX upIVR4iiUT7DFfkmgl0ZDG79R3blv/jXlAcBKA68OTXQ76F65jgj7ONmuGfhruHYEbF4 BwQ6nOlBBBD/NaZFuOQ1bLvsKF2DSPxqCwo4KYWkipH93EUxZxzqAJsp0EamoFHjYdKL 9G1wFNSOyeZqLI/DpPAtZLsF15vA/IYQODEhxqsqoLsJj6S8AsQ9RrbaafenRQKBL3kO DmYQ== X-Gm-Message-State: APjAAAUCmisFfb2jYRN/B0uYguVm3/j0W97WYzHbNoKzQPfezpfN6JDG jcGjCi8Z4kxZkSYIHRkTfMvyPTfK+7WIIxKGHBzuaYMNWcg= X-Google-Smtp-Source: APXvYqw9AXVAucq1RU6gcS6RRWM3ULWKJW8qFBU08w6nJFvsSKDdMh0gcD04pSMH7TM4RT4w92DWYxxjkYaxha1Pa3g= X-Received: by 2002:a05:6808:3a4:: with SMTP id n4mr301276oie.100.1561584176409; Wed, 26 Jun 2019 14:22:56 -0700 (PDT) MIME-Version: 1.0 References: <2c0a414b-859d-3c25-d92a-048c1b8b259f@xs4all.nl> In-Reply-To: <2c0a414b-859d-3c25-d92a-048c1b8b259f@xs4all.nl> Date: Wed, 26 Jun 2019 23:22:45 +0200 Message-ID: To: PHP Internals Content-Type: multipart/alternative; boundary="0000000000001f30b8058c40a6dd" Subject: Re: [PHP-DEV] [RFC] Strict operators directive From: arnold.adaniels.nl@gmail.com (Arnold Daniels) --0000000000001f30b8058c40a6dd Content-Type: text/plain; charset="UTF-8" Hi Dik, Thanks for taking the time to review this RFC. On Wed, Jun 26, 2019 at 10:44 PM Dik Takken wrote: > 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). I would argue the following; The explicit use of the strict_operator is intentional, meaning that the author consciously chose to be strict and does not expect some operators to still be non-strict. The issues pointed out, apply to all comparison operators. Ignoring == and != in the RFC creates an inconsistency, while not properly addressing those concerns. > 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(). > :+1: > Regarding the switch statement: While it is not an operator, one could > argue that it is a case of implicit use of an operator. > I agree. Internally it's defined as an operator even. Still, I'll put this up as a secondary vote. > Regards, > Dik Takken > --0000000000001f30b8058c40a6dd--