Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:102251 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 60809 invoked from network); 14 Jun 2018 04:53:26 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Jun 2018 04:53:26 -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.52 as permitted sender) X-PHP-List-Original-Sender: php@golemon.com X-Host-Fingerprint: 74.125.82.52 mail-wm0-f52.google.com Received: from [74.125.82.52] ([74.125.82.52:55883] helo=mail-wm0-f52.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 51/17-29356-4C4F12B5 for ; Thu, 14 Jun 2018 00:53:24 -0400 Received: by mail-wm0-f52.google.com with SMTP id v16-v6so8166580wmh.5 for ; Wed, 13 Jun 2018 21:53:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=golemon-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:from:date:message-id:subject:to; bh=HqUc4Y47GqY8n38LNEQ3g4vEOnH8hOHBwAmv9/plXvQ=; b=ZyPDM4rZJIR3HhwgcesqSr6bCbBKSgq5O3zQzXj/r4cLA7KN/yrJh6HlqRubpUZeaJ IuJmv4GGXxJq+ORp+/djg6q3VoGlOOfec4r6nraI9TAqw/1Bte9U3kxko2RrKvod8xQA 2KBTk9X+55oAbpg56sp8bZRgJCC7McOLmkNyERICwcskWZDwrp1hCzWJHa76p1XVQgRG Id76dT5RCmZ+bTw3YCL2MB/HoMa0fVLAzkGko1+yG2F165BQ1VXzUdVg95ngWB6M7wOB XxSvJxckrq3bkGrL6vccyT4fEXeWb85bjX/r8SRP8PQwufJjOj025+EJt4C1U5INZeWU ub1g== 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:from:date:message-id:subject :to; bh=HqUc4Y47GqY8n38LNEQ3g4vEOnH8hOHBwAmv9/plXvQ=; b=QBvhEw11ppaVKjd74c6xy09fs2tMswfVHn9nWxXNha9AzxWINc0kt5yMvXiuZ+D9m/ IGW265RF4OicxPn2i4lqtXETJYYL5Flx4ZCYd6dB45FrIbUFwK/nvRLlUxMOcqVfXWgw ajbIQey8P2SUS52QisuUdI7HabPcZqE4Z9nRyME8qSr0QjCcR35t6saQemcPVRGBZRiq 1fSev3fngq/KaUtUnYDgj6fuZCQIy97/psgb1UlXmAjga3w0RUnL5qpcropuWqaiAuL+ rt8EhacMBTL0h+U9SJC5FJkExAS3u4LbPKVPrSEmvGAbFUdCXjLI8e7n/BJBoeXSOCob n9og== X-Gm-Message-State: APt69E3ybk3n9xdnon8LP6emKOPRPWRWtcWSYszhIYfgE8V+So4cfQ/J f8dODIc5qTGtMn8MKXbiCPA7N0673age1kRwpbFu8QN60ag= X-Google-Smtp-Source: ADUXVKLztKQR/DsTutaFDLEiu/XtlpM+jBpYoZAeyd3sijc02Ch6fI4VtU0ivptZRUYWFuOWNvjKJVgcu5pNWi2TQPM= X-Received: by 2002:a50:e282:: with SMTP id p2-v6mr996161edl.253.1528952001267; Wed, 13 Jun 2018 21:53:21 -0700 (PDT) MIME-Version: 1.0 Sender: php@golemon.com Received: by 2002:a50:8625:0:0:0:0:0 with HTTP; Wed, 13 Jun 2018 21:53:20 -0700 (PDT) X-Originating-IP: [98.116.190.42] Date: Thu, 14 Jun 2018 00:53:20 -0400 X-Google-Sender-Auth: _cAQO2uAAHqwAEt59ibXH_kBgpQ Message-ID: To: PHP internals Content-Type: text/plain; charset="UTF-8" Subject: Strict switch statements From: pollita@php.net (Sara Golemon) Just for casual discussion at this point: https://github.com/php/php-src/pull/3297 switch ($a) { case FOO: // Works exactly as current behavior. break; case == FOO: // Nearly identical, though not using the ZEND_CASE optimization. // Can probably make this equivalent to `case FOO`, but it felt like an interesting direction. break; case === FOO: // Only triggers if `$a === FOO`, no type juggling break; } Love it? Hate it? See obvious flaws? The implementation is just a rushed proof of concept, not something I've labored over, it may well have bugs. Certainly wouldn't target anything earlier than 7.4, if at all. -Sara