Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:109363 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 63340 invoked from network); 26 Mar 2020 23:39:42 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 26 Mar 2020 23:39:42 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 39D541804D0 for ; Thu, 26 Mar 2020 15:04:41 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Thu, 26 Mar 2020 15:04:40 -0700 (PDT) Received: by mail-wm1-f46.google.com with SMTP id c81so9033773wmd.4 for ; Thu, 26 Mar 2020 15:04:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=5Q9dgBRuJv82BY5xuDxsrRwvYeEtw8lSooscovUyXdc=; b=RGQXLPuAekllGaqZ62Ay5Edn9vCDC8HzHMXUjaYjB5DGD94ZPeuxmb031RV61W1G4y dSOCvBTPrfCIZmOQ8cTM8rvvRrUolUp8mTJOQ0Ce01/g1kswZ139K0Bq6Gm0kky2OhJm V2raOxHQw1XZTZfQ3Ehd9oN97T3zZNuEE8jFcHWTCW64yTf1pohh/vUfBxeWoQrKJDeV vsFciqKwBx8EgwxQuXkQydZYXXGZOaWYeGzHiif6tg0M/4xQTGn6qkB7hibpQAuCCm7o id/9H7VH27apTN6q+VFc1VLi1JLWaQZvBwTzRvQ/FAjB588HBlSVeCMJv2QTb/kCUL1U JvLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=5Q9dgBRuJv82BY5xuDxsrRwvYeEtw8lSooscovUyXdc=; b=O0kGd1HArIOWbOh/I3VrH9/Lp27l1oFGHb/9WhHXB34pTr2gwF2JFwXGyDyGkJ24+/ ay0s8x3MaeKKROmS9H4WkQlx94uEP9xwv0Es4Wk8a1O82e/mwId1jTbXlAWzvo0FcC3B Blg7ggyBnKSdguvOPUUilyDg/RFw5QFw6IIfBiRrl1X0zT2ntIRqb5HJZWHxRzVo/i8T UjfvcoA9csH6pJTGN2+vVwmTqAYYmZTkb0uAyouWOIeqxKC8r4Q8dswtwykTPx4jTpzS XkMAGjQaHuApjrcxQC552aUH3+Wq2HMT9RPq7Afcrd1uUSg99+o75WeEij/G69WUviTr X5dg== X-Gm-Message-State: ANhLgQ2buw52Rg0cy50L+dQ25xyW3zInAnCoPOg875jHbqKiC54ZPVAX zhIRjdpRJc+D3kTLbZRgT3M= X-Google-Smtp-Source: ADFU+vtskq3CkF3c8U465t99XLQYFV1aI+Kt3fA0dQzagOAB3P1cxdNBB87WTKbIEVT2pGAhjssVvQ== X-Received: by 2002:adf:efcd:: with SMTP id i13mr11273266wrp.355.1585260276622; Thu, 26 Mar 2020 15:04:36 -0700 (PDT) Received: from [192.168.0.63] (84-75-30-51.dclient.hispeed.ch. [84.75.30.51]) by smtp.gmail.com with ESMTPSA id f9sm5093531wrc.71.2020.03.26.15.04.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Mar 2020 15:04:35 -0700 (PDT) Message-ID: Content-Type: multipart/alternative; boundary="Apple-Mail=_26CD1BC3-A31D-4145-8800-210960F745C7" Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.80.23.2.2\)) Date: Thu, 26 Mar 2020 23:04:34 +0100 In-Reply-To: Cc: PHP internals To: Ilija Tovilo References: X-Mailer: Apple Mail (2.3608.80.23.2.2) Subject: Re: [PHP-DEV] semicolon terminator for switch cases From: claude.pache@gmail.com (Claude Pache) --Apple-Mail=_26CD1BC3-A31D-4145-8800-210960F745C7 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > Le 26 mars 2020 =C3=A0 19:37, Ilija Tovilo a = =C3=A9crit : >=20 > What's the reasoning behind this? I find it weird an inconsistent. >=20 This is a manifestly a leftover of an old syntax. Take a look at the = PHP/FI 2 manual: Language constructs: https://www.php.net/manual/phpfi2.php#lang = ``` ``` and, in particular, switch construct: https://www.php.net/manual/phpfi2.php#switch = ``` ``` Note that every line of code, including `if (...);` and `case...;`, is = consistently terminated by a semicolon. In a subsequent major version, the syntax was modified, and you would = use a colon instead of a semicolon in a number of places, as you can = write today: ``` ``` Although the old `if (true);` syntax has been removed (probably because = of ambiguity or difficulty of parsing), the old `case 1;` syntax could = be left without issue. =E2=80=94Claude --Apple-Mail=_26CD1BC3-A31D-4145-8800-210960F745C7--