Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:102265 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 8503 invoked from network); 14 Jun 2018 16:45:00 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Jun 2018 16:45:00 -0000 Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.47 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 74.125.82.47 mail-wm0-f47.google.com Received: from [74.125.82.47] ([74.125.82.47:53529] helo=mail-wm0-f47.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C5/7D-29356-B8B922B5 for ; Thu, 14 Jun 2018 12:45:00 -0400 Received: by mail-wm0-f47.google.com with SMTP id x6-v6so11618586wmc.3 for ; Thu, 14 Jun 2018 09:44:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=pXuUZ+xRw3mNK5ivf3yaNB44KWaM43PyNIb3PoDPUmw=; b=mfEZr/miA0ajHApWHkNcARfnKE5rkIkouSW7SLDIZKVCQM9Xwsv1HCI9cyFrv+AY1W OPX0+KTSHDm3+c+Q51AMYWy63zfAnrxN7Kt/y6r4yaqePZ2ZHgBnv5Q4SM2w3Mg8WZnH vrKMQL2E7oNKYcsM2qE2tZnPSks7dKOvWHfLU35gqfX4wBtVqqbTRhJDcHqd2AgXbTgs Le0uamD87Xvzd5PM7tWfj58B32EfobaZosW2C4AqsaKPPeZ8G7Oor8ccs6hHyST1P6Xw 9Ac2f8oplg2C6QrlVTq9SRh5cB/GzuiJLRVTgfFihpwJZaWfUHaE7a3xT27X8cTP1+Wm w2Xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=pXuUZ+xRw3mNK5ivf3yaNB44KWaM43PyNIb3PoDPUmw=; b=oR/gk9sS/ZQxLxgU3NEJzvL85gLTqgYcHlcM8+3bUrNdANMD6GbSOuQnf8OkVaeV/m VnsclbXMn7rYp04XRvhGD4D6IEHY0efuK1UdgbYsmVtDs5raJWyG1lGeS/YSyQ9RtyzB tkHMYgo2/S1xEYpiH0X/JlWQ6ovoB87FHZdzWO4OIJniL+cCoMMcm3iCxd6Ff+rYt6iM 0mtIMo1W9xXVfFJS6nQi40/xodYM1IyGHZeLxOgS8klO+bbQNameHBzGskLdDrKhTsAL fhiSjs5+64HL6/p2IpjWdB+Tl1prrrBc4IzFBIlN1mOSfgWWtBGuA1dXRfjjpRnwF4lQ J5QQ== X-Gm-Message-State: APt69E2YV/p7/rVTP39+jSXasUJ9A04ZG9C3UIeTcQ4Zxx1FK562lfhK SrFrrfezJqxRntfvUjftNFJVy7BkPUMIjIXRBZE= X-Google-Smtp-Source: ADUXVKIl6cqMVtEf6mzGhnpQkuz0oLsViyx0qJ8ZyptqrYA1RiLUPneRiFqtJWpnoskUQz9Swa9RVnT4IOxlPFFXHxg= X-Received: by 2002:a50:9a21:: with SMTP id o30-v6mr3281849edb.236.1528994697262; Thu, 14 Jun 2018 09:44:57 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a50:8d55:0:0:0:0:0 with HTTP; Thu, 14 Jun 2018 09:44:56 -0700 (PDT) In-Reply-To: <53d1a1f6-10b8-3aec-c2ac-a005d6041f15@librelamp.com> References: <20180614155730.2C8BC1A8027C@dd1730.kasserver.com> <53d1a1f6-10b8-3aec-c2ac-a005d6041f15@librelamp.com> Date: Thu, 14 Jun 2018 17:44:56 +0100 Message-ID: To: Alice Wonder Cc: PHP internals Content-Type: multipart/alternative; boundary="000000000000cb3bf5056e9cd171" Subject: Re: [PHP-DEV] Strict switch statements From: rowan.collins@gmail.com (Rowan Collins) --000000000000cb3bf5056e9cd171 Content-Type: text/plain; charset="UTF-8" On 14 June 2018 at 17:16, Alice Wonder wrote: > > Should declare(strict_types = 1) do that? > > I haven't tried, but I would think it should. No, it doesn't, and shouldn't. "strict_types" actually means "non_coercive_scalar_type_hints"; it's a very specific feature, controlling a specific set of situations, not a catch-all "strict mode" for anything type-related. I suppose we could have a new directive that magically changed the default for the "strict" parameter of array_search, et al. But if that converted switch, would it also convert == itself? And then would we need a new syntax for "opting out" and using the loose comparison? Would the resulting confusion of people not seeing which mode a file was in be worth it? This is exactly why I think the word "strict" should be avoided at all costs; it's just far too ambiguous. Regards, -- Rowan Collins [IMSoP] --000000000000cb3bf5056e9cd171--