Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:102263 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 4368 invoked from network); 14 Jun 2018 16:10:19 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Jun 2018 16:10:19 -0000 Authentication-Results: pb1.pair.com smtp.mail=php@golemon.com; spf=softfail; sender-id=softfail Authentication-Results: pb1.pair.com header.from=php@golemon.com; sender-id=softfail Received-SPF: softfail (pb1.pair.com: domain golemon.com does not designate 74.125.82.46 as permitted sender) X-PHP-List-Original-Sender: php@golemon.com X-Host-Fingerprint: 74.125.82.46 mail-wm0-f46.google.com Received: from [74.125.82.46] ([74.125.82.46:35369] helo=mail-wm0-f46.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B1/CC-29356-A63922B5 for ; Thu, 14 Jun 2018 12:10:18 -0400 Received: by mail-wm0-f46.google.com with SMTP id j15-v6so13118177wme.0 for ; Thu, 14 Jun 2018 09:10:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=golemon-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=BanLiG+rwtjPDvsLzMMuc0Zxv/ZFrvXM5yVEaVdtoNM=; b=nxkD4zFdtw/pFpfZtm0MgfzFNy583pmHqRHtHG26Fn3NaT6FGNV4EXVrDCvr9Ohy1L Ozh8Ksszc6x5PPhx2YOvmj1BIzIE2FR4o3/nrviBnFsFPebpFTVM8YlfZZmEVZ4EVpcu DUlDvQAGp7mHzjNPLNKFkCOxjFyqF2CR59osG812gr3tao6Sx+VQ+Ltqp+Kmf9Crr9pc AqiZ46S5Pc/lX1Zwy7HlFRAqqe+JgxKay1YAadPIQWRCW7HpEVBX6lRdNzUodz66T9yF JqhIYyFlfD08P8W6ZJO2rBnT0/zxZ/LHcTD1qCWjQR7uZT9pOWmDPkOcMK9b7yzw0mYO pF0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=BanLiG+rwtjPDvsLzMMuc0Zxv/ZFrvXM5yVEaVdtoNM=; b=TpZc3eCgN77bJfskZ8BE50JHUAWrZ7hAgqasXyzdORq63Y2s/Xyvx2L8lfbR+j06TK /yWuUI/J1DONlx+iT+SyrrPfcwS/RxjcTgnpfhczi6OQ1AZWFbSjgiIrhBbEzBMUNMVI xvUB5YP4bOsTZP/blSlmx+54bx3zh5qhp8a2D1uMeJK4I8ZNo3AnFbjrFrqsGFVOWCfy Uq1LN+YT5hwhak7Av7dpRjdfXkqrDMDAyrTZ/8kYX9RK/TyLOGZk9FyZxgJc5Z6p7TR4 BZHiScKXnUWvrqSzyZUP8qiT85rVfCBjZdGw7bahCv9hRLX4oyv0kfyqdsoi+nrYMpi7 guRg== X-Gm-Message-State: APt69E0e6yEY56HgQpvIXobGpvo9F7daHNeKtuZlMnC51emByhhrnyDf 4aNDlB209HMSdOB3qIfYxnzJ0PXb/oSYgLcoPLy3GcF4 X-Google-Smtp-Source: ADUXVKJS64CbEL05pL3fYY/lK87QWSCVak9ZCmqMMgvD+ah7v9qVqRv/L2IP5BywhGOAFoArivSbBuNOiSZ3Sigr+uA= X-Received: by 2002:a50:b0c2:: with SMTP id j60-v6mr3271974edd.188.1528992615601; Thu, 14 Jun 2018 09:10:15 -0700 (PDT) MIME-Version: 1.0 Sender: php@golemon.com Received: by 2002:a50:8625:0:0:0:0:0 with HTTP; Thu, 14 Jun 2018 09:10:14 -0700 (PDT) X-Originating-IP: [206.252.215.26] In-Reply-To: <20180614155730.2C8BC1A8027C@dd1730.kasserver.com> References: <20180614155730.2C8BC1A8027C@dd1730.kasserver.com> Date: Thu, 14 Jun 2018 12:10:14 -0400 X-Google-Sender-Auth: AnKcMqE6R4bbxxQv-ODpacYrhp8 Message-ID: To: Thomas Bley Cc: Nikita Popov , PHP internals Content-Type: text/plain; charset="UTF-8" Subject: Re: [PHP-DEV] Strict switch statements From: pollita@php.net (Sara Golemon) On Thu, Jun 14, 2018 at 11:57 AM, Thomas Bley wrote: > for simplicity I would use an extra parameter to have a strict comparison (similar to the extra parameter in in_array()): > > switch ($a, true) { // strict comparison > switch ($a) { // loose comparison > I instinctively recoil from boolean arguments as they tend to be opaque at a glance, but perhaps: switch ($a, ===) {...} Would both be more apparent as to its meaning and leave the door open for other uses. Though at that point, tbqh, I think `switch ($a) use (===) {...}` gives better visual isolation. -Sara