Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:112687 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 13111 invoked from network); 30 Dec 2020 21:49:23 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 30 Dec 2020 21:49:23 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 36DAF1804CF for ; Wed, 30 Dec 2020 13:24:10 -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=-0.5 required=5.0 tests=BAYES_05,DKIM_SIGNED, DKIM_VALID,SPF_HELO_NONE,SPF_NONE autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mx.kolabnow.com (mx.kolabnow.com [95.128.36.40]) (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 ; Wed, 30 Dec 2020 13:24:09 -0800 (PST) Received: from localhost (unknown [127.0.0.1]) by ext-mx-out002.mykolab.com (Postfix) with ESMTP id 1E739653 for ; Wed, 30 Dec 2020 22:24:08 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kolabnow.com; h= content-transfer-encoding:content-language:content-type :content-type:in-reply-to:mime-version:date:date:message-id:from :from:references:subject:subject:received:received:received; s= dkim20160331; t=1609363447; x=1611177848; bh=bD2vrCV4YAx5QmOCSn1 oYUiLV0vwaGLvsxM0ILLOgMk=; b=1f/zhy3TehmfxsFaoTOywE/kC4wiuzSuumx gXtYoXI36jWXiYGvhGGDq6jnnI6Fo83mI9QZhQxzIzVwjPP0wWAVjWcM3pS8lwlp /10SmhRbCfPHbqdjkORG0QtHpqEoDbutRXi4uiiSeGwspMn/kndclpuBpthmM4Gp sI4sQK/6RKgGAdSomnHLcqVH54EHMjFJ6gKpbTeKK6bf/pOPmUfYZEJCu1WXvDx8 YC9lJGWBE9ryBglPQbFeBhHiltvS60HSucM7CPSLAiqh5rGMjWMXCxK7oTnP/V6q EIEbV8OzyhI52wJLC2jii1rrOmolOUcxhgN7Yd6rQR5VjAJsdJo4vImeinMKUCgv TGa1xQSXAEGtISBu8j5D4wL+rmgLV17TvjQNnsvIMjvol2gMNn4qEh5M7yPBQ47b t3QEqhjU5JW65lryASqNQN3ucN6xhsYynEariHtRnUfEIqhsZQEIk7QFkvGYL7lQ yNJ1xWl7nJzi0PxcgM0ZcG/t9VLREvLupN5QhOJRFiuqfnPnf74rRGsn6a9UJoL8 5XkF5R7liNUmn8ZrEqNm8p2+Wv3XIY67gVasRCb0wGQScGwGHDi7kJJ3WoBiBCgY wOKU3zuJ/rEdGkVMqNBUMVzxAaojCzao/w85tO+329BK5CytqoHGg6BgZ9bGAfLg qY/N5h1I= X-Virus-Scanned: amavisd-new at mykolab.com Received: from mx.kolabnow.com ([127.0.0.1]) by localhost (ext-mx-out002.mykolab.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id XoSqGfYt4vue for ; Wed, 30 Dec 2020 22:24:07 +0100 (CET) Received: from int-mx003.mykolab.com (unknown [10.9.13.3]) by ext-mx-out002.mykolab.com (Postfix) with ESMTPS id 8BF2E5BA for ; Wed, 30 Dec 2020 22:24:07 +0100 (CET) Received: from ext-subm003.mykolab.com (unknown [10.9.6.3]) by int-mx003.mykolab.com (Postfix) with ESMTPS id 43EAC244A for ; Wed, 30 Dec 2020 22:24:07 +0100 (CET) To: internals@lists.php.net References: <8aa05350-05fc-df9d-e5d6-fa0f4feb57ba@alec.pl> Message-ID: Date: Wed, 30 Dec 2020 22:24:05 +0100 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC] Enumerations, Round 2 From: alec@alec.pl (Aleksander Machniak) On 30.12.2020 21:21, Larry Garfield wrote: >> enum Suit { >> case Hearts = 'H'; >> case Diamonds = 'D'; >> case Clubs = 'C'; >> case Spades = 'S'; >> } >> >> 'H' === Suit::Hearts->value; // true >> 'Hearts' === Suit::Hearts->value; // false > > That's a possibility we've been kicking around. I'm considering it, Ilija doesn't care for it. :-) What's your argument in favor? My argument is that, from an end-user perspective, I don't really see why Unit and Scalar enums have to have different "API" at this point. I'm talking about ":string"/":int" in the enum definiton as well as ->value and ->from(). -- Aleksander Machniak Kolab Groupware Developer [https://kolab.org] Roundcube Webmail Developer [https://roundcube.net] ---------------------------------------------------- PGP: 19359DC1 # Blog: https://kolabian.wordpress.com