Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:112746 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 82737 invoked from network); 4 Jan 2021 11:40:27 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 4 Jan 2021 11:40:27 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id E6759180503 for ; Mon, 4 Jan 2021 03:16:22 -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.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_NONE autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from vie01a-dmta-pe01-3.mx.upcmail.net (vie01a-dmta-pe01-3.mx.upcmail.net [62.179.121.156]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Mon, 4 Jan 2021 03:16:22 -0800 (PST) Received: from [172.31.216.235] (helo=vie01a-pemc-psmtp-pe12.mail.upcmail.net) by vie01a-dmta-pe01.mx.upcmail.net with esmtp (Exim 4.92) (envelope-from ) id 1kwNqW-0005bv-05 for internals@lists.php.net; Mon, 04 Jan 2021 12:16:20 +0100 Received: from mail02.home ([213.47.1.177]) by vie01a-pemc-psmtp-pe12.mail.upcmail.net with ESMTP id wNpXkyMfTO4rAwNpYkPopI; Mon, 04 Jan 2021 12:15:20 +0100 X-Env-Mailfrom: markus@fischer.name X-Env-Rcptto: internals@lists.php.net X-SourceIP: 213.47.1.177 X-CNFS-Analysis: v=2.3 cv=RNDN4Lq+ c=1 sm=1 tr=0 a=/qIKuKYhvfCm6iufBMIR7Q==:117 a=/qIKuKYhvfCm6iufBMIR7Q==:17 a=IkcTkHD0fZMA:10 a=MKtGQD3n3ToA:10 a=1oJP67jkp3AA:10 a=EmqxpYm9HcoA:10 a=2EALvoLjsrEA:10 a=ZZnuYtJkoWoA:10 a=T21SbIa3AAAA:8 a=UqN9g0Aj_QQLN8uarywA:9 a=QEXdDO2ut3YA:10 a=SnCPDuWYnhHfdy9Ed-Bx:22 Received: from mail02.home ([192.168.1.14] helo=the-matrix-has-you.local) by mail02.home with esmtp (Exim 4.72) (envelope-from ) id 1kwNpW-0003o9-JA for internals@lists.php.net; Mon, 04 Jan 2021 12:15:19 +0100 To: internals@lists.php.net References: <8aa05350-05fc-df9d-e5d6-fa0f4feb57ba@alec.pl> <4eec7448-f7ab-9955-8c2d-68cd4f822535@gmail.com> <7d8ce2a2-8d85-4312-af22-da643faa3a7f@www.fastmail.com> <1BC8BF20-B961-4360-855B-5BB95338BB8A@newclarity.net> Message-ID: Date: Mon, 4 Jan 2021 12:15:18 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: <1BC8BF20-B961-4360-855B-5BB95338BB8A@newclarity.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam_score: -2.9 X-Spam_score_int: -28 X-Spam_bar: -- X-Spam_report: Spam detection software, running on the system "scanner01.home", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Hi, On 03.01.21 12:01, Mike Schinkel wrote: > So in my perfect world this: > > enum BookingStatus { > case PENDING; > case CONFIRMED; > case CANCELLED; > } > > Would be equivalent to: > > enum BookingStatus { > case PENDING = "PENDING"; > case CONFIRMED = "CONFIRMED"; > case CANCELLED = "CANCELLED"; > } [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.0 URIBL_BLOCKED ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [URIs: externals.io] -0.0 NICE_REPLY_A Looks like a legit reply (A) X-CMAE-Envelope: MS4wfF+2DOLBuuB7N70s63pL/mnpNhdgJ08kZPG7Ytj5JhZArLm9vkyldAN5Obi1ZroCzr1aPYC3ru4yhVPGVfBPTA68hpzreYl36O1SYx4XyDknGl5wK8NF 5Ml68W4iLCjtKGe3nv9reqOY6adAOB92Yz5voWRNDZyG3/vPHoDh5aZq Subject: Re: [PHP-DEV] [RFC] Enumerations, Round 2 From: markus@fischer.name (Markus Fischer) Hi, On 03.01.21 12:01, Mike Schinkel wrote: > So in my perfect world this: > > enum BookingStatus { > case PENDING; > case CONFIRMED; > case CANCELLED; > } > > Would be equivalent to: > > enum BookingStatus { > case PENDING = "PENDING"; > case CONFIRMED = "CONFIRMED"; > case CANCELLED = "CANCELLED"; > } I'm with Mikes' suggesting here, see also my previous messages [1] [2]. I don't know how to back this up with numbers, but the way I see it the majority of use cases will have a benefit of being able to directly use the literal values derived from the lexical ones and the ability to have custom values is feature next to it. [1] https://externals.io/message/112626#112655 [2] https://externals.io/message/112626#112663