Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:127703 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 466C51A00BC for ; Wed, 18 Jun 2025 09:24:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1750238572; bh=QCPq5WMUirrcj6scPxD9k1XNOSk7DVT40jZcmFOzctM=; h=Date:From:To:In-Reply-To:References:Subject:From; b=Qd7Q6n1oQfNseC/PAx7tUUQusceOX2Rc8sZ4LdRwDZ606iseINNQc4HgyM/9JAlPY mS//FiFNjqcFd3YDGLbO10TcgOwo85ZheShIrWMINWtKD0vVuQRFkn3zauFc4wsQ5O KrFZ0UnUPqacOb1PWEeNLuE7EwzSSfxERC6YdPIbapCGSN07pY4IWqnp6d8NizPDgA 5p5iYOJzw/ydZnGz6GE1h6EUwoW3LkpZSIhAR+A+OS7JDQbYiUTX8PaPwuyW44Kqv5 VW6pRcqDpdJB115iHoBjP36LE7nwax6VAzrYueqJr3ft85DJ4CiKqnXhjgmNeY76Q2 vXhXRbzTGAgiw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 6659F1801D4 for ; Wed, 18 Jun 2025 09:22:51 +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,HTML_MESSAGE, 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-a1-smtp.messagingengine.com (fhigh-a1-smtp.messagingengine.com [103.168.172.152]) (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, 18 Jun 2025 09:22:50 +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 83E61114019F for ; Wed, 18 Jun 2025 05:24:48 -0400 (EDT) Received: from phl-imap-05 ([10.202.2.95]) by phl-compute-05.internal (MEProxy); Wed, 18 Jun 2025 05:24:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bottled.codes; h=cc: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=1750238688; x=1750325088; bh=QCPq5WMUir rcj6scPxD9k1XNOSk7DVT40jZcmFOzctM=; b=JxfBaLTji3v8CwiFCe6Y1j2vR2 ODNSydRBPj978IXVdFBtlQpvoakglFHiDgATjkqsz/ylqaSBAcFAKb0ZFZuPviR+ VbgdOqkUPkT4rK1An1WObv9TkD55f2RR9ru+mSGFrc/jYBvEULGtIaGYAQsIa0lI oRqmZWImErxPZyHNKX0d7xTXAT8o2o394BEQ6ywnB0cBBcZx0taKzadN390LrdOI V313jsoyVCCk3qYSLSd62K8F4mab0Nxg7enlK4Xe+mPG3435aVoIQYJgdiAaBO0/ cq6ltojOBpjMZpURJPPl++2c5jVF0BTMAh4fp8mVtmoJbdny2pPiYgab4NJA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc: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=fm1; t= 1750238688; x=1750325088; bh=QCPq5WMUirrcj6scPxD9k1XNOSk7DVT40jZ cmFOzctM=; b=XKPx3kmV1xmU3KYiofBCdLB5U3SZFKFr6UWS6eb3Uw139qJTINn W29s0jRaG7uUUdQp4093+GciAcNBwib4XPHQSRaTUflvXBM7SrbUsK4tRz8jQGUI fot83hCgec5PoGYhMNvrYYjScMbmY7wzKeurOo/1SXDLWpbVcyFlaJuxZkddX1lJ A3Aqf+QuoX9Q2sVxRZANV0N33VQ8Cegx/1AhBGp9lBcafhpSbE3ofFafs6JbmRJ5 T32oYdgiLUtl9GowcaDYyanNB7Zzcvy/F+eJ1rFgmLRXkyMQje3hNB84nhTNOpt/ nmbf44V0HIApeQS9BM4Ky9DPJx2csz0pmLQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtddvgddvvdejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucgoufhushhpvggtthffoh hmrghinhculdegledmnecujfgurhepofggfffhvffkjghfufgtsegrtderreertdejnecu hfhrohhmpedftfhosgcunfgrnhguvghrshdfuceorhhosgessghothhtlhgvugdrtghoug gvsheqnecuggftrfgrthhtvghrnhepleefueeikedvieehkeetlefgfedutdekveehieeu heeljeetkeeikeeiheeukedunecuffhomhgrihhnpehphhhprdhnvghtpdhgihhthhhusg drtghomhdpfehvgehlrdhorhhgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghm pehmrghilhhfrhhomheprhhosgessghothhtlhgvugdrtghouggvshdpnhgspghrtghpth htohepuddpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepihhnthgvrhhnrghlshes lhhishhtshdrphhhphdrnhgvth X-ME-Proxy: Feedback-ID: ifab94697:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id E45351820076; Wed, 18 Jun 2025 05:24:47 -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: Tdffe2a2312921c9a Date: Wed, 18 Jun 2025 11:24:25 +0200 To: internals@lists.php.net Message-ID: <1a17d11a-eea7-4f8b-b4f9-bd2a3f71b7d6@app.fastmail.com> In-Reply-To: References: Subject: Re: [PHP-DEV] [RFC] [Discussion] #[\DelayedTargetValidation] attribute Content-Type: multipart/alternative; boundary=e7252a9ebab742ccb165c4ca3894a04c From: rob@bottled.codes ("Rob Landers") --e7252a9ebab742ccb165c4ca3894a04c Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On Wed, Jun 18, 2025, at 01:26, Daniel Scherzer wrote: > Hi internals, >=20 > I'd like to start the discussion for a new RFC about adding a `#[\Dela= yedTargetValidation]` attribute. >=20 > * RFC: https://wiki.php.net/rfc/delayedtargetvalidation_attribute > * Implementation: https://github.com/php/php-src/pull/18817 >=20 > --Daniel Interesting. I=E2=80=99d also argue for the inverse more than this, thou= gh. I=E2=80=99d like for my attributes to be validated during compilatio= n instead of delayed to runtime -- which, it isn=E2=80=99t actually. Run= time validation ONLY happens when calling ->newInstance() on ReflectionA= ttribute, and never before then. So, only when an attribute is actually = read during reflection is it validated. Further, if you never actually i= nstantiate it ... it is never actually validated (i.e., just looking for= the presence of an attribute, not the details). https://3v4l.org/UqQKi =E2=80=94 Rob --e7252a9ebab742ccb165c4ca3894a04c Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable
On Wed, Jun = 18, 2025, at 01:26, Daniel Scherzer wrote:
Hi internals,
I'd like to start the discussion for a new RFC about adding = a `#[\DelayedTargetValidation]` attribute.


Interes= ting. I=E2=80=99d also argue for the inverse more than this, though. I=E2= =80=99d like for my attributes to be validated during compilation instea= d of delayed to runtime -- which, it isn=E2=80=99t actually. Runtime val= idation ONLY happens when calling ->newInstance() on ReflectionAttrib= ute, and never before then. So, only when an attribute is actually read = during reflection is it validated. Further, if you never actually instan= tiate it ... it is never actually validated (i.e., just looking for the = presence of an attribute, not the details).

=E2=80=94 Rob
--e7252a9ebab742ccb165c4ca3894a04c--