Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:130529 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 7DD6A1A00BC for ; Thu, 2 Apr 2026 09:25:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1775121940; bh=2aGyIDWFXZ8bazZcs7XDdu5obJSmyVx1IM2i1EHb6hg=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=HJX5oe0VLI56FW3B1pcQanW2TVlgX7E5tRR9NkBMq1MUyJ72UE3dyXTXLFh8+GnwJ BLdY31xPFiHJizSXOFTrZwDIpKmqrKBPN4m55jvTSwHH0B8uRRRTr0aYQKZ13O2dNe WZ8rQyRphMWuRsCqzp5I0jxOL2IJJCOisQ0yeehGWYAHDuSVRB7/Uf70bF4aco8bxL DmCu2OeY0IQyLxdk67b1c2lx7fCuT0eT9dVp4NkpmsIarMJbE3LLWL2TMK9CHhDq/l ZrcD6Ou87rnoBvW7lk3veALeq18hGF9h5j3wu+Sdb68vmlFVpAhh4RECNFQ6TPEx3M YxadQJycw2Hcw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 4AC99180061 for ; Thu, 2 Apr 2026 09:25:39 +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=0.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from chrono.xqk7.com (chrono.xqk7.com [176.9.45.72]) (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 ; Thu, 2 Apr 2026 09:25:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bastelstu.be; s=mail20171119; t=1775121931; bh=Ze8ILE8XYN92BkFqLqfJwtWixJ4ItsA8+HwD1UdIKIo=; h=MIME-Version:Date:From:To:Cc:Subject:In-Reply-To:References: Message-ID:Content-Type:from:to:cc:subject:message-id; b=Ixpg/hskDhx8d3UszmoZ7+K0EIURKm32m1lS/NoeNKuz+k5BajjotxMZ41dNpH0ik nMNGXxmKAb7ncRFtXsc8sbJThEkJ99+GfPoYHFzsVXNccO7Yu1jC8f1W9dhbiuL1jA X25jXtqFzA8W1uF/sB8Kw+LpPHTeyQ2qVsAJcgQ6+6/LGDIChV89fFmEkDLXbIMdY3 kx+LRCXD2Vsbp1sPxuGlMvuykx3XjDcVf5mnCjirQPGZrEwcTPpjSWFFz1DHw9A07s yrgTVK3kdxpG38Hu1HWILeC58GuF5OB2qfjMLAT7Qh+2spnfCuhWiQ6mBTDMpxdbJk cG5y+Fk7pwuMw== Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 Date: Thu, 02 Apr 2026 11:25:31 +0200 To: Daniel Scherzer Cc: php internals Subject: Re: [PHP-DEV] [RFC] [Discussion] `#[\Override]` for class constants In-Reply-To: References: Message-ID: <7d16cc9dcf0a84ce81a93f89947eb6b2@bastelstu.be> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit From: tim@bastelstu.be (=?UTF-8?Q?Tim_D=C3=BCsterhus?=) Hi Am 2026-03-31 01:36, schrieb Daniel Scherzer: > I'd also like to draw specific attention to the open question, which I > am > soliciting feedback on: how should `#[\Override]` work for enum cases? > See > the RFC page for details. We've been pretty clear so far the “enum cases are just constants”, e.g. in the RFC for `#[\Deprecated]` (https://wiki.php.net/rfc/deprecated_attribute): > Enum cases are internally implemented as class constants. Adding the > #[\Deprecated] attribute to an enum case will behave as expected. Given that: interface NamedX { public const string Name = 'foo'; } enum Foo implements NamedX { case Name; } is a thing already and fails with: Type of Foo::Name must be compatible with Named::Name of type string as expected and interface NamedX { public const Name = 'foo'; } enum Foo implements NamedX { case Name; } without defining the constant's type just works by the enum case shadowing the interface’s constant it seems consequent to allow `#[\Override]` on enum cases, even if likely not particularly useful. Best regards Tim Düsterhus