Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:127707 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 F208E1ADC9D for ; Wed, 18 Jun 2025 11:59:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1750247824; bh=E19UFL0B8qdkbmAl+1mi4bb+f8F3y9W0XiUEEmZk4Ak=; h=Date:From:To:Cc:In-Reply-To:References:Subject:From; b=hrJ++xSihZhOLmfW5Rk5M7wg7/7KpeV/+QZ4B7jnihZCJGmFHHGY2XlTfvoDJ2mD5 I/4JYOOSrLmyJcvfF8vW0ohwCQPX6k0+ir0lYaxazgcoP80k2GJ7c4LIZXoqhoZ7EY /s38k5V9bEVuxUgRvJTogCZTN3m88F4h43kZdERG+4iH2AKgXx00RSVUqO6J5mbkev WKyEt/YM0DpVGsRBL1vgqK6WW53DdPqH9jvC0vz88ByELFGsWrg/Ib26GlhO50qFEx /eFDVlcPTODL4aHglXaB/G2e6wlxnXTaebu8MPZpRI5Q/DTL5V0KCej9x14/Ddntlm YSCUhxHvZ1A5w== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 2AB5C18020B for ; Wed, 18 Jun 2025 11:57:02 +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 fout-a8-smtp.messagingengine.com (fout-a8-smtp.messagingengine.com [103.168.172.151]) (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 11:57:00 +0000 (UTC) Received: from phl-compute-05.internal (phl-compute-05.phl.internal [10.202.2.45]) by mailfout.phl.internal (Postfix) with ESMTP id EFB111380396; Wed, 18 Jun 2025 07:58:57 -0400 (EDT) Received: from phl-imap-05 ([10.202.2.95]) by phl-compute-05.internal (MEProxy); Wed, 18 Jun 2025 07:58:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bottled.codes; h=cc: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=1750247937; x= 1750334337; bh=E19UFL0B8qdkbmAl+1mi4bb+f8F3y9W0XiUEEmZk4Ak=; b=Q A7So1y6NdW6wsNiLSVE7B9NniJyzxXJFF4cgCYSn2Nnw3JDc/vnSgK9gupN4t6k5 1XCcD0Gr50V2ifsU95xZVAoa9jdgsDaW61vsC6lJLW3slEYsFNKZsnIFupR36leL bmNy6KGmMfi5HDZkYHXRtThT17L1A7Gkdl/025v8dt4KRoeQR6/t5Y+aPOPFI7Bk tmW9BqCWwS1G3Heydg43mhXHdfopEMN5VolM/vn0hHsGTq7XU11iWTo/HLE8Sq/s K8dbatBCBcHG/MbadyjjV8uGLOTedXRpccpcs9oLqmhRXi3oMphzNzKj1fzjdRkR LJO6IZUmmYLEuMVzJcgpQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc: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= 1750247937; x=1750334337; bh=E19UFL0B8qdkbmAl+1mi4bb+f8F3y9W0XiU EEmZk4Ak=; b=YddtR+ReE7QNX+HXbgTXwPEjtnTGN7Ub6xwZMpNJECn+Qk1uft0 nblie31MkeOkoYKW16HSESfDN7cOwVSGaSIvESFQZPYWOJWercOr2YuXT+EYmrLd c7XRGDUEhf8K3kxhTNQ3ofgsWSQaYx0MSd+s3xvxodS1RKCTZ6er+9DoRBfI5G07 TrSBdOqNeGu+MX50/3M4KPjUQ/WbbqAtvwcqpUaor6V7OVt2jlMl6SrZqqSRhl5U W2lCv3Q6cUrRyTJNrLqhgDhfhEPXOU1oTTrgAwpEs3s3sdcLE95z57VpHRWxIqAI kXPIvInfZSdvvWPG0gmd87JNc86Q0ZyjCkw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtddvgddvheekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucgoufhushhpvggtthffoh hmrghinhculdegledmnecujfgurhepofggfffhvfevkfgjfhfutgesrgdtreerredtjeen ucfhrhhomhepfdftohgsucfnrghnuggvrhhsfdcuoehrohgssegsohhtthhlvggurdgtoh guvghsqeenucggtffrrghtthgvrhhnpefhhfefvdelffevffdtgfeivefgkeegfeejheej heefudetgfevhfdtudekfeehveenucffohhmrghinhepphhhphdrnhgvthdpghhithhhuh gsrdgtohhmpdefvheglhdrohhrghenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgr mhepmhgrihhlfhhrohhmpehrohgssegsohhtthhlvggurdgtohguvghspdhnsggprhgtph htthhopedvpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopehkohhnthgrkhhtsegs vggsvghrlhgvihdruggvpdhrtghpthhtohepihhnthgvrhhnrghlsheslhhishhtshdrph hhphdrnhgvth X-ME-Proxy: Feedback-ID: ifab94697:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id A22B11820073; Wed, 18 Jun 2025 07:58:57 -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 13:58:36 +0200 To: =?UTF-8?Q?Benjamin_Au=C3=9Fenhofer?= Cc: internals@lists.php.net Message-ID: In-Reply-To: References: <1a17d11a-eea7-4f8b-b4f9-bd2a3f71b7d6@app.fastmail.com> Subject: Re: [PHP-DEV] [RFC] [Discussion] #[\DelayedTargetValidation] attribute Content-Type: multipart/alternative; boundary=cf6991bf214041569f4ae788ac12a19f From: rob@bottled.codes ("Rob Landers") --cf6991bf214041569f4ae788ac12a19f Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On Wed, Jun 18, 2025, at 13:09, kontakt@beberlei.de wrote: >=20 > Von meinem iPhone gesendet >=20 >> Am 18.06.2025 um 11:26 schrieb Rob Landers : >> =EF=BB=BF >> 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 `#[\De= layedTargetValidation]` attribute. >>>=20 >>> * RFC: https://wiki.php.net/rfc/delayedtargetvalidation_attribute >>> * Implementation: https://github.com/php/php-src/pull/18817 >>>=20 >>> --Daniel >>=20 >> Interesting. I=E2=80=99d also argue for the inverse more than this, t= hough. I=E2=80=99d like for my attributes to be validated during compila= tion instead of delayed to runtime -- which, it isn=E2=80=99t actually. = Runtime validation ONLY happens when calling ->newInstance() on Reflecti= onAttribute, and never before then. So, only when an attribute is actual= ly read during reflection is it validated. Further, if you never actuall= y instantiate it ... it is never actually validated (i.e., just looking = for the presence of an attribute, not the details). >>=20 >> https://3v4l.org/UqQKi >=20 >=20 > As Daniel=E2=80=99s rfc mentions you need to differentiate between com= piler and userland attributes.=20 >=20 > The compiler attributes are validated at compile time not dueing newIn= stance. >=20 >>=20 >> =E2=80=94 Rob Yes, but when would it check it during runtime? It doesn't say in the RF= C. From what I can tell, it effectively disables the attribute, unless s= omeone happens to enumerate and instantiate all the attributes (which is= unlikely). =E2=80=94 Rob --cf6991bf214041569f4ae788ac12a19f Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable


On Wed, Jun 18, 2025, at 13:09, kontakt@beberlei.de wrote:

Von mei= nem iPhone gesendet

Am 18.06.2025 um 11:26 schrieb Rob Landers <rob@bottl= ed.codes>:
=EF=BB=BF
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 `#[\DelayedTargetVali= dation]` attribute.


--Daniel

Interesting. I=E2=80=99d also = argue for the inverse more than this, though. I=E2=80=99d like for my at= tributes to be validated during compilation instead of delayed to runtim= e -- which, it isn=E2=80=99t actually. Runtime validation ONLY happens w= hen calling ->newInstance() on ReflectionAttribute, and never before = then. So, only when an attribute is actually read during reflection is i= t validated. Further, if you never actually instantiate it ... it is nev= er actually validated (i.e., just looking for the presence of an attribu= te, not the details).



As Daniel=E2=80=99s rfc mentions you need to dif= ferentiate between compiler and userland attributes. 
The compiler attributes are validated at compile time n= ot dueing newInstance.


=E2=80=94 = Rob

Yes, but when would it check it during runtime? It doesn't say in the R= FC. From what I can tell, it effectively disables the attribute, unless = someone happens to enumerate and instantiate all the attributes (which i= s unlikely).

=E2=80=94 Rob<= /div> --cf6991bf214041569f4ae788ac12a19f--