Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:127982 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by lists.php.net (Postfix) with ESMTPS id 4D61A1A00BC for ; Wed, 9 Jul 2025 22:21:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1752099588; bh=RcoJGRRONNKaTGLtMg+jdyIO3BWVXqcwJ8m7VEWj9bk=; h=Date:Subject:To:References:From:In-Reply-To:From; b=bnrHUSdPx7B98N3m488QSqZpnLEfdbYDWjKKhwpwZ4EyUge6PGVRF9NcTAT2/8rPK RBjPJWQi0TNe9kijrx7wLZAYtJ9eqr7IqU3bUsxKweMnoP5KlPBoWk8Eqt9WbPyaOA A2F1HnnMSd/pjZwT6SY6bQar3joxcmXm2/LUPRuqMQOy1+QQ0uwI0vsmYvNqlVlWXw Rw3ZaR4TZ40JW7Hh9dPEab7oNUP1bGSLJtYmxXtt/vihN6uRZHyONFPBKzsvehQ5Vm IpSCAK7xT303Tk561eqVnomA2JAMz4k4dK2A0ls9LY5D4OfZrmxQEi58M9vsS4eDeU 0Dr0I3SUGO/gg== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 1F400180053 for ; Wed, 9 Jul 2025 22:19:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_05,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS,SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: Error (Cannot connect to unix socket '/var/run/clamav/clamd.ctl': connect: Connection refused) X-Envelope-From: Received: from fhigh-a7-smtp.messagingengine.com (fhigh-a7-smtp.messagingengine.com [103.168.172.158]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Wed, 9 Jul 2025 22:19:47 +0000 (UTC) Received: from phl-compute-05.internal (phl-compute-05.phl.internal [10.202.2.45]) by mailfhigh.phl.internal (Postfix) with ESMTP id 198641400236 for ; Wed, 9 Jul 2025 18:21:37 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-05.internal (MEProxy); Wed, 09 Jul 2025 18:21:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rwec.co.uk; h=cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1752099697; x=1752186097; bh=W9g82nPvObcCz6iIP88aYKHt3NQX4K38M3h4goK+tl0=; b= iUYipVwM1WgVj0mJk/M/Wlb/Nhs1qTffH126jw5auQDKX5665FRXUdTo3MfOvlK+ 2S7BlBiSfRwfGT88QNmbc2lQT7lnLyXttZ+Lls3SVI2x9HZqj9aqXxZruTj6yNZM CJkeZYAhsNUdHZJY2ccWZ/h9MEmbu6pjyKe68eWILfVLNZGlujAWozHiEp2OpS0R Jgq+IH0dAe1KrJ+Mko70xXOTEOxoxdLHKD2LmbkMWlVasMjz8HbfVqOkZlvLP2hw 0C/qNlbABf3igJwjBHEoiH3XEX/C588dTHFkHdanP+v6D6o5D5pdsZLNTY81dNXT 530CS8ItEyZ37c2A++2Pqw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; t=1752099697; x=1752186097; bh=W 9g82nPvObcCz6iIP88aYKHt3NQX4K38M3h4goK+tl0=; b=TE0jmzjhOAhRLudaJ juNt4MegZER0cO6xw/BKKdqe7/XfxplOdDM6RaOc/Vgu+aDOkhFWoLYp/fQZBkKI kw6G05UkDDcgnPRo24m5aMGKMiT1jMOalMkYRyL9XnaFvAt1ZNLZ6hxEl0L16qkC SM9Sy5TpY5SzjYnmGYzwmhLZzcRfv4ORRLSNZ6kK9PZvbILymuvEXvskX9tEJcOx vAIOOtesDYlZduy9SOWaRaW1K89rHmWFAvRg05ZPTVZf2qa0SUwE3JGKDLDfdeeL k/iwipDM+Oco3YT7y4ImXhtfG1YzdbkmaCNKpRL+565LuK88Ia3xunBsHHIoOP5h 6u3vA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdefgdefkeejhecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecunecujfgurhepkfffgggfuffvfhfhjggtgfesthejredttd dvjeenucfhrhhomhepfdftohifrghnucfvohhmmhhinhhsucglkffoufhorfgnfdcuoehi mhhsohhprdhphhhpsehrfigvtgdrtghordhukheqnecuggftrfgrthhtvghrnhepjeekgf fhuefggfdtueehgefgudeghfdukeejhfetgeeijeelheevlefhfedvhfdunecuvehluhhs thgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepihhmshhophdrphhhph esrhifvggtrdgtohdruhhkpdhnsggprhgtphhtthhopedupdhmohguvgepshhmthhpohhu thdprhgtphhtthhopehinhhtvghrnhgrlhhssehlihhsthhsrdhphhhprdhnvght X-ME-Proxy: Feedback-ID: id5114917:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Wed, 9 Jul 2025 18:21:36 -0400 (EDT) Message-ID: <88dfb74c-bf68-451c-bfe3-a8b1a0d12d58@rwec.co.uk> Date: Wed, 9 Jul 2025 23:21:35 +0100 Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PHP-DEV] ::from() and tryFrom() on Basic Enums Content-Language: en-GB To: internals@lists.php.net References: <5a38b818-8366-4edc-93ab-a147e3a9aec3@app.fastmail.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit From: imsop.php@rwec.co.uk ("Rowan Tommins [IMSoP]") On 09/07/2025 17:39, Deleu wrote: > It's currently undeniable that a Unit Enum name is a string. So is a class name, as accessed by $foo::class. $foo->name on an enum case is really just the same kind of pseudo-reflection, in my view: it's telling you information about the source code, useful primarily for debugging. If you want to associate a single string value with each enum case, use a string-backed enum, and propose some short-hand syntax. Please leave unit enums as opaque objects for those of us who see value in that. -- Rowan Tommins [IMSoP]