Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:107594 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 13315 invoked from network); 21 Oct 2019 00:01:20 -0000 Received: from unknown (HELO php-smtp3.php.net) (208.43.231.12) by 76.75.200.58 with SMTP; 21 Oct 2019 00:01:20 -0000 Received: from php-smtp3.php.net (localhost [127.0.0.1]) by php-smtp3.php.net (Postfix) with ESMTP id 81CFE2C7727 for ; Sun, 20 Oct 2019 14:44:51 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp3.php.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS3215 2.6.0.0/16 X-Spam-Virus: No Received: from mail-yw1-xc2e.google.com (mail-yw1-xc2e.google.com [IPv6:2607:f8b0:4864:20::c2e]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp3.php.net (Postfix) with ESMTPS for ; Sun, 20 Oct 2019 14:44:50 -0700 (PDT) Received: by mail-yw1-xc2e.google.com with SMTP id m7so4213188ywe.4 for ; Sun, 20 Oct 2019 14:44:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=newclarity-net.20150623.gappssmtp.com; s=20150623; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=yNhA2Junrspt6YH5bTc2u4iAXCODisIzIUSEGwvNG/E=; b=X4GvvgkD8Z8n3XtT3xDh4Sk/9bgksN6QJMvn7+w/o64apfIx4xOffbv7RIzM00QWHF kfl4szXZDw45AQdDCB9KxHMNI4MaZ4imzolQ0y2lpj4f/S8nMmX6Ki92UsiGijppu9kO a/M2HkzUA1lsgchLGMPstMxKn9zCOqHtoichDGm/WgfIZNGcpQtDNiDq3NZXZB7NW015 SpHXdiRPuyUWmB/uUnx9cnHWyU76ZwzOsC4bJk6FjH65rV4h6BlgqfP43iCf2heRcfb6 BDVAo09LOyxczAFTfSNp7pg31nTGGSv87gL6gjrksWuadWr6BK5sbqc20cF3/AYDgKhi EKAw== 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=yNhA2Junrspt6YH5bTc2u4iAXCODisIzIUSEGwvNG/E=; b=mumpJFXZqx6Cw33w7UlXS9P8dHm9yYIST56jyOi2qBrUablIqDhNESvGDBM44tkzvf kl8psq0nKHJ8e13KftYS4APrSabysf1i4rlVWT9CqDIzVHQHCv/vug9B58LSN5UXx8yC TSL1FtyFwe2U8wMfy7PRhIR7dVCXw4XXcou+XqzrpMdGVbfZwLEbnnF8RvG8vJ8vS28k UbNRTts5S0wSGZQKwFlanhtdHXnuPY8+80o0aTVrts1pNn8019cpR3tslyJHgm4Lk+6N 3ovHFxlaucSgWn3cPvNP+bdWFBR2vzEHlVQPcP0bAdI8Rdb5/niqE/luPaKVQFwB1Mu+ zC6Q== X-Gm-Message-State: APjAAAUPqZTXlsPPq4Vs+T9YU/5YiKzPSx/8kwTrZxGQLMbuPZ9e4Qbp DRkQK/jMZif+MvowX5rWGSouPw== X-Google-Smtp-Source: APXvYqzL6icZGp1eX24k0/IYi2CNYzP5Jd8mw3yS8aTx1wo8nQmjwNLwLl/7jB+7Nr/DzMA4S5DwXA== X-Received: by 2002:a81:a004:: with SMTP id x4mr14766219ywg.175.1571607889653; Sun, 20 Oct 2019 14:44:49 -0700 (PDT) Received: from ?IPv6:2601:c0:c67f:e34e:dc33:30b5:913d:fcb2? ([2601:c0:c67f:e34e:dc33:30b5:913d:fcb2]) by smtp.gmail.com with ESMTPSA id a20sm3154965ywl.76.2019.10.20.14.44.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 20 Oct 2019 14:44:48 -0700 (PDT) Message-ID: Content-Type: multipart/alternative; boundary="Apple-Mail=_EA64FF1D-ACA2-467E-814F-5B95FF878DBE" Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Date: Sun, 20 Oct 2019 17:44:48 -0400 In-Reply-To: Cc: internals@lists.php.net To: Rowan Tommins References: <929062F1-E83F-4D81-B2C6-3916B744E101@newclarity.net> <5da8e051.1c69fb81.b05ef.ef7dSMTPIN_ADDED_MISSING@mx.google.com> <11ada3a9-ee9a-1364-7a06-96d1533d544b@alec.pl> <1E765C07-5503-4A23-949D-F2D79E9C2164@newclarity.net> X-Mailer: Apple Mail (2.3445.104.11) X-Envelope-From: Subject: Re: [PHP-DEV] Adding explicit intent for SWITCH/CASE fall through? From: mike@newclarity.net (Mike Schinkel) --Apple-Mail=_EA64FF1D-ACA2-467E-814F-5B95FF878DBE Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > On Oct 20, 2019, at 7:28 AM, Rowan Tommins = wrote: > On 20/10/2019 01:39, Mike Schinkel wrote: >> Not yet having experience working on PHP's parser I do not know how = it is configured nor what about the design of PHP requires keywords = unable to be used as constants, class names, function or method names. I = know this is a tangent but that seems like a requirement designed to = simplify the parser maybe, and not because of any logical requirement. = So I assume whatever word was used for this would also have to be a = reserved keyword? Or not? >=20 >=20 > I don't know the full implications in the parser, but at the language = level, any constant can technically appear where this keyword would. = That is, the following is valid right now: >=20 > const fallthrough=3Dnull; > fallthrough; >=20 > It doesn't do anything, but it's valid because any expression on its = own is a valid statement, and a constant on its own is a valid = expression. Thank you for clarifying that. Still, I wonder if a reserved word really needs to disallow function, = method, class and trait names, which are more problematic to me. I have = often wanted to name a class 'List`. And I have often wanted to name a = method `do()`, `continue()`, `end()` and `try()`. =20 Seems like a needless limitation thus forcing the use of less = appropriate symbol naming. > Interestingly, that actually makes a single keyword *more* appealing = to me, because it means you can get *forwards* compatibility by writing = this: >=20 > if ( PHP_VERSION < 80000 && ! defined('fallthrough') ) { > define('fallthrough', null); > } Oh, that is interesting!=20 Too bad you can't define a constant to call an initializer method. -Mike= --Apple-Mail=_EA64FF1D-ACA2-467E-814F-5B95FF878DBE--