Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:112658 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 30448 invoked from network); 30 Dec 2020 12:52:52 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 30 Dec 2020 12:52:52 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id AAADA1804DC for ; Wed, 30 Dec 2020 04:27:34 -0800 (PST) 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, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) (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 ; Wed, 30 Dec 2020 04:27:34 -0800 (PST) Received: by mail-wm1-f52.google.com with SMTP id k10so4857811wmi.3 for ; Wed, 30 Dec 2020 04:27:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding:content-language; bh=uQnw47iX5DzIQuH3Nr9eDdRe9R1Xuqm3f7Qtq9pd+cw=; b=FCqoZHwV3TuLUmyz+1kOOrDaRtgvpE3qpvyBFR5qed9KnravnnLGfD68QE068TYthU J1lvzdvtyhuvZJjITRNdFgMrrHOktCl0vuYxhmTn6IfspT4jb3NO3ET0+yF1ROdG9MAX mGYOpgsLPndfebCD57Tx+s2Tz39rc9Rz06SgbvyrhFw7nHHqZBz6x338gLSJ+r+HSuQs URQfg+4o47gccsa1132D8Qb0zBFSWUn8S/pie7YLeYQPLCM8tH/VdEcIwNwTMWOJY6a3 PIOm0rbeSKcKCH4LMsd53HOf7Gsbu9OfWrcFDF3UVfySV8YdYEMyBLwCFfTzzsiWkPPn IaQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=uQnw47iX5DzIQuH3Nr9eDdRe9R1Xuqm3f7Qtq9pd+cw=; b=B65W4HGu/5ltwkI0RVRnaxIbgs2ZXxVR/VIZqDoSEvXc8+kxW2F870Z7fAx5YCnuBi GpcfWv0+7OmifH6keveXZeLccn6r1T2OxUzt2cMYwgGB4XziwR5i6yWKPSTQ0OzM0Cpz z4g/oBfmUL4McKLtyiIDE4cvOqWsPs4eTpkNiMV/4RWpDFJ6UuijeEwNl0xtcBQf89bV WshrAH+pBzyMF/RGuUpGDFOlykD9iM6CMwkJdQk5rIBokp+wMcDWY3u2aHFf/Lyq1eq+ Hk6gouDwstGPZuCT3GC+m3SXk5EZ7LyuEqCOs17+pJQhSnWH7Cl7jCp2PoWqz5SA/GUX WP3Q== X-Gm-Message-State: AOAM533g9nd1/UNLWdTwZIzHvsfxFJhr3CnBzVCjap1WDIpzcTl6Ujvf jiSIiRmWm90bJSy46PiwZ0vb+mOCZmAzXQ== X-Google-Smtp-Source: ABdhPJxRLd8G2r2ZBW0tRWFVG1RW7N2ljy5qHRQSmEIo8fWymIwNgBp4qqngTS/DL06xLfBGZ2Ygew== X-Received: by 2002:a05:600c:274d:: with SMTP id 13mr7461790wmw.77.1609331251802; Wed, 30 Dec 2020 04:27:31 -0800 (PST) Received: from [192.168.0.22] (cpc104104-brig22-2-0-cust548.3-3.cable.virginm.net. [82.10.58.37]) by smtp.googlemail.com with ESMTPSA id j10sm7724390wmj.7.2020.12.30.04.27.30 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 30 Dec 2020 04:27:31 -0800 (PST) To: internals@lists.php.net References: Message-ID: <012f426d-ff07-fce7-d642-c64bafa5aaf5@gmail.com> Date: Wed, 30 Dec 2020 12:27:28 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-GB Subject: Re: [PHP-DEV] [RFC] Enumerations, Round 2 From: rowan.collins@gmail.com (Rowan Tommins) On 28/12/2020 20:21, Larry Garfield wrote: > After considerable discussion and effort, Ilija and I are ready to offer you round 2 on enumerations. Thank you both, again, for all your efforts. I'm pleased to say that I like this draft even more than the last one. :) A couple of points that occurred to me reading through: - The magic methods section lists __call as allowed, but not __callStatic; was this deliberate, or just an oversight? - Under Future Scope, the "Grouped Syntax" sub-section says "That would only work on the simple, non-primitive-backed case with no methods defined [...] it is unclear how common that will be in practice" This caveat doesn't apply to the current proposed syntax, and should perhaps be re-visited. Given that this is currently a legal declaration: class Suit {   const Hearts = 'H', Diamonds = 'D', Clubs = 'C', Spades = 'S'; } It seems fairly reasonable for the enum version to allow the same syntax: enum Suit: string {   case Hearts = 'H', Diamonds = 'D', Clubs = 'C', Spades = 'S'; } Or, for a non-scalar enum: enum Suit {   case Hearts, Diamonds, Clubs, Spades; } Regards, -- Rowan Tommins [IMSoP]