Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:128230 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 9D1E31A00BC for ; Fri, 25 Jul 2025 16:43:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1753461677; bh=bNtGpC0IGFDfBem+gGo8EQcZ5E2qjfbwOuSu6GE/qoQ=; h=Date:From:To:In-Reply-To:References:Subject:From; b=KOA2CIy7ErwsOzUCvT6ZQUpZkx4Gu2bPRj5XP8lsMyN7VCYIExs74p4LDDFZnksQ/ DH28yWkHsbnJq4CDurIk0jvc8Fva8x+1ryYE8W9CdkuGbFwNmCTANn8q1p+Fvn0gux gtcSosq9t7dMDq24IWKJeqyS21nGMIWzCVFu8RKiMM18KPuktwpfMLEuJuZZIs3Dcw uqpDvsZF2Lyes59xGiQ/VOHAZWzWuJljVjgW/eKD5QBAbwqtwI2COZceyGk06R2AnP s6mWqmkGdMBdfZNWHPMs/B35NDTUTOkLmTw3Bt0EUT45H8vpvCCvCL77VwkLGWagBx tdcBBsXz3pf/A== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 529D7180083 for ; Fri, 25 Jul 2025 16:41:16 +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=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS,SPF_NONE 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-b2-smtp.messagingengine.com (fhigh-b2-smtp.messagingengine.com [202.12.124.153]) (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 ; Fri, 25 Jul 2025 16:41:16 +0000 (UTC) Received: from phl-compute-10.internal (phl-compute-10.phl.internal [10.202.2.50]) by mailfhigh.stl.internal (Postfix) with ESMTP id 9A5917A01D4 for ; Fri, 25 Jul 2025 12:42:59 -0400 (EDT) Received: from phl-imap-02 ([10.202.2.81]) by phl-compute-10.internal (MEProxy); Fri, 25 Jul 2025 12:42:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= garfieldtech.com; 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=1753461779; x=1753548179; bh=2Mxh8yz2SzSofI0ASrXa7 JXawje5pwHi4GJw53M53nE=; b=YYL7iPVjoady8MDm7bmJT0atdGI4JVaFVdx6i XNvRVjRqbAiejWavr/pgoPEufHT9djOPh4b5d07vQ0XFVAXeZvl0HunIwR/64pnC sG2o9EFSWJ2O5gfRPBTLfJbe2HSSPdbBqi0TS1Y/dbNVX5fu/ZeMWtDQDDXjp9tv XS6V2GPMdVeVprzm8bkkwWpcNrxPnKWkHsmoZKhgXyb+2rV9Z+HaPcgACqXtm0Yy UpBVQh8Rw65/tkUHZT+x9MbQDQiDHQBFQsYFE4RD1lfJSlBdXmK1G/kL1mLUOTF7 05AH1KElgDWRS3mzDEyCIX8X+5DVspyC4+hJHXIcZd+BM43ig== 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=1753461779; x=1753548179; bh=2 Mxh8yz2SzSofI0ASrXa7JXawje5pwHi4GJw53M53nE=; b=L2okwoPFG3R09l18T rbzKVwNlxiPNrH8vP9bLtbCmqSuhtD9/++p7Ndfs6h2uBqb/XO/4UiG5l5P44Z6j TkNHMGWRhdIVpACx63lCxTmnsrCBoTiH62jiwUnaegFp8pVn/vvjSmYoZ4R0Xatn CbqGi3+F/FyTiuksB/8ao4qmcb/IcKP67rsB2P9SL6bldCEfH4evnFibk/jDtVw0 q4ciwCaUmXD8teeyWK9Tp5h94v4J9oBFYwZJklz04OtOhiS/axlpE+Vp23xeLsgk nEYOPHhSi+z2YbK9WL38GbN/H9B5gEvxQRvKG2PO4eqVt16n8NMxovDCaLPa2N5C jA4WA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdefgdekgedtgecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjug hrpefoggffhffvkfgjfhfutgfgsehtjeertdertddtnecuhfhrohhmpedfnfgrrhhrhicu ifgrrhhfihgvlhgufdcuoehlrghrrhihsehgrghrfhhivghlughtvggthhdrtghomheqne cuggftrfgrthhtvghrnhepueehjeduleetleeiheelleelkedvtdfgtedtgefhgfeghedv jeegjeefffeuhfdvnecuffhomhgrihhnpehgihhthhhusgdrtghomhenucevlhhushhtvg hrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehlrghrrhihsehgrghrfhhi vghlughtvggthhdrtghomhdpnhgspghrtghpthhtohepuddpmhhouggvpehsmhhtphhouh htpdhrtghpthhtohepihhnthgvrhhnrghlsheslhhishhtshdrphhhphdrnhgvth X-ME-Proxy: Feedback-ID: i8414410d:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id 0CA0B700065; Fri, 25 Jul 2025 12:42:59 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 X-ThreadId: T1ca969cfb88337c1 Date: Fri, 25 Jul 2025 11:42:38 -0500 To: "php internals" Message-ID: In-Reply-To: References: Subject: Re: [PHP-DEV] Validating #[\Attribute] targets Content-Type: text/plain Content-Transfer-Encoding: 7bit From: larry@garfieldtech.com ("Larry Garfield") On Fri, Jul 25, 2025, at 11:33 AM, Daniel Scherzer wrote: > Hi internals, > > The #[\Attribute] attribute is used to mark classes as being usable as > attributes. It currently does not trigger any error if added to a > trait, interface, enum, or abstract class. However, if any of those > *were* used as an attribute, calling ReflectionAttribute::newInstance() > would fail; if you are not going to call > ReflectionAttribute::newInstance(), then you don't really need to mark > the trait/interface/enum/abstract class as an attribute. > > I have proposed https://github.com/php/php-src/pull/19154 to add > validation to the #[Attribute] attribute, and it was suggested that I > post here on the mailing list in case there were any objections. So, > are there? > > -Daniel I just checked AttributeUtils, and I don't *think* this will cause an issue. I do support interfaces and opt-in inheritance, but I don't believe it actually tags an interface with #[Attribute] anywhere. --Larry Garfield