Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:127704 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 122EB1A00BC for ; Wed, 18 Jun 2025 11:09:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1750244862; bh=2bbrJKniHA/XG/VvmAtcs9iPyMJJ1THqxAbRcdj6vMk=; h=From:Subject:Date:References:Cc:In-Reply-To:To:From; b=oMQNWvj6x8+Kw4b2lsJD3FnZ99SboW2WLzD49rbEr9AJGhIoO0+dOkqg+6m3VJGPf YkrSAwpkSV6Zo/IcG54cOKK3EZvOBSDmqCocY+tVOSLxZEc73VbX0FEF5u9zpf6Vi2 6LN1FkOyK2tLBw4dkedu3GOPcPEdEUtDWs+Zj78LwXq42FnxWd3bQwNZiGKsiSFVrw AnIlHSPJO43ajjEoLNFEB/buLfu4aIoGmOkWeIDCA451ZhHuXlru0/StHDgc61zfjI KW78ntcWyLuufaMTYfwhPJHOblFqO31KBKDIXQQve8ECiBZt44W0MNlSSSQ6G6fDi2 XruruMQpzxEZw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 821801801E6 for ; Wed, 18 Jun 2025 11:07:41 +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.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DMARC_MISSING,HTML_MESSAGE,MIME_QP_LONG_LINE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,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 mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) (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:07:41 +0000 (UTC) Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-450cb2ddd46so38159145e9.2 for ; Wed, 18 Jun 2025 04:09:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=beberlei-de.20230601.gappssmtp.com; s=20230601; t=1750244978; x=1750849778; darn=lists.php.net; h=to:in-reply-to:cc:references:message-id:date:subject:mime-version :from:content-transfer-encoding:from:to:cc:subject:date:message-id :reply-to; bh=iQZMRBOGTuJGzhB098Hfuyz9RcR6aFmbp6D7MCpYr7c=; b=CJBLa8lzu6QzYwLkudlnMzW/+Qk7m9g7re8TuBC1YpfM+v1BlZIpY+Z0qhxZjsUKLr Kgohm6x0H7hJQNlhdLrLQz79qBe0zRpOeRk5kHpRwIZ31Pu6teUbdque9Gu+tjn36CKU pL16KjI4YO6HbqcOIORBXxa8dE2oS60t8VfWKhqQJDPSBxAmFBbhkTDhYvMLpLFXGcZR qkDg5QpTabseIRhSh0B0nFU/Sds+zNJX5hR2YaiPhCNiIGxRHzCAL9QNPlRpf4cRpNT2 Gi5nMBQ0ZYJdjSBJBUTdtLPC0Yg7N0r6zupl872fyymuLlMIBkmuQyKfcO2fCs8MhevF mZSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1750244978; x=1750849778; h=to:in-reply-to:cc:references:message-id:date:subject:mime-version :from:content-transfer-encoding:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=iQZMRBOGTuJGzhB098Hfuyz9RcR6aFmbp6D7MCpYr7c=; b=HPdzDDpM0T19Hv7DpSmTSdZSR6Pxo4KqUR7C+YWvtw4Du0r9nEbURhuSMi9F5Zc+C+ xZj5vqXLGRD7I++esx+2ZQA7GYDUh/ITmzkikqXMMbAVnqAkZEAgLnEIemTizml/DL8Z iYu8Qq3ckJjdZNz9Z8wKqhrVdr8qItjJUNWMrl/ijwbqz6WB+a3PUQ6qn5sWoKBhlapZ 3gElE02wvx98r6fEse1FOh8ZfS7tINvuA7aHTe6qA/wudO21CXxjx9BfMA5hTmoY87LC CtE8xZgdc5PdnzJJAiuIXhSuwZoILsPdJ4OLf2nxmQgoAngGEKIJ030TinIYEgLTP5Co JnvQ== X-Gm-Message-State: AOJu0Yz4Pn76gGAhvSUy8JMPkrtbSZYc78BdA0kM3eMY5JfxqmPCokWA bsVylehDwt+XnuscaSz1HP0tA4NBwJYqSrp61YJ+cMpCjHyoZ4grJrAWZokUmFCQPZMp99TM/Av UgN3zJog= X-Gm-Gg: ASbGncslv7oWauactr7MxZyssj1N6ZVSoc9RMPPUGJ93vWTLARGa4att3itXLpv1ztd McYryaNNWZ7tX44vTa4wealFLwUviSTmF3YHIYrHCkVKW3xCjSXt3M/XaelkL+vNOzezML7zv74 dGlXYVQ7ML0SnPj0MupmxdFV0YTxC/QSsdT+Fbg8gMHcoQzkO8vR6HrHuaS3/zi2J45H4sqQzgv cPVJe0Tkr1ElFdgbtG1paSEHmVvWo9sj+E5tU54XRZv1RF9dG2KWBMp/cpqRLE37Pk7BOwPl2qc sqgjj87J15Od4BO/sGwZK1wDeHdwnRSS51f9siM32ZrVwcV2nbiIDOGfiofXfMrddgez2q2kErP dqIALSATlYhZupbdbnL523YdstEnAzVi0MStzAg== X-Google-Smtp-Source: AGHT+IFLCknTeDn90t5WGn2rXemCy2sRc+XZMLlgjpaAKalwNRqzVqGAg722w6U0AeS8XRE/cbBgNw== X-Received: by 2002:a05:6000:2007:b0:3a5:25e0:1851 with SMTP id ffacd0b85a97d-3a5723660b5mr14215504f8f.7.1750244977769; Wed, 18 Jun 2025 04:09:37 -0700 (PDT) Received: from smtpclient.apple (tmo-080-90.customers.d1-online.com. [80.187.80.90]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a568b1eb9bsm16795815f8f.69.2025.06.18.04.09.36 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 18 Jun 2025 04:09:36 -0700 (PDT) Content-Type: multipart/alternative; boundary=Apple-Mail-9296EB00-647F-4919-B94A-7AC00B391CBA Content-Transfer-Encoding: 7bit Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow Mime-Version: 1.0 (1.0) Subject: Re: [PHP-DEV] [RFC] [Discussion] #[\DelayedTargetValidation] attribute Date: Wed, 18 Jun 2025 13:09:26 +0200 Message-ID: References: <1a17d11a-eea7-4f8b-b4f9-bd2a3f71b7d6@app.fastmail.com> Cc: internals@lists.php.net In-Reply-To: <1a17d11a-eea7-4f8b-b4f9-bd2a3f71b7d6@app.fastmail.com> To: Rob Landers X-Mailer: iPhone Mail (22F76) From: kontakt@beberlei.de --Apple-Mail-9296EB00-647F-4919-B94A-7AC00B391CBA Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Von meinem iPhone gesendet > Am 18.06.2025 um 11:26 schrieb Rob Landers : >=20 > =EF=BB=BF >>=20 >> 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 `#[\Delayed= TargetValidation]` 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, though= . I=E2=80=99d like for my attributes to be validated during compilation inst= ead of delayed to runtime -- which, it isn=E2=80=99t actually. Runtime valid= ation ONLY happens when calling ->newInstance() on ReflectionAttribute, and n= ever before then. So, only when an attribute is actually read during reflect= ion is it validated. Further, if you never actually instantiate it ... it is= never actually validated (i.e., just looking for the presence of an attribu= te, not the details). >=20 > https://3v4l.org/UqQKi As Daniel=E2=80=99s rfc mentions you need to differentiate between compiler a= nd userland attributes.=20 The compiler attributes are validated at compile time not dueing newInstance= . >=20 > =E2=80=94 Rob --Apple-Mail-9296EB00-647F-4919-B94A-7AC00B391CBA Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable
=
Von meinem 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 Sc= herzer wrote:
Hi internals,

I'd like to start the disc= ussion for a new RFC about adding a `#[\DelayedTargetValidation]` attribute.=


--Daniel

Interesting. I=E2=80=99d also argue for the inverse more than this, thoug= h. I=E2=80=99d like for my attributes to be validated during compilation ins= tead of delayed to runtime -- which, it isn=E2=80=99t actually. Runtime vali= dation ONLY happens when calling ->newInstance() on ReflectionAttribute, a= nd never before then. So, only when an attribute is actually read during ref= lection is it validated. Further, if you never actually instantiate it ... i= t is never actually validated (i.e., just looking for the presence of an att= ribute, not the details).


=

As Daniel=E2=80=99s rfc mentions you need to differentiate be= tween compiler and userland attributes. 

The compile= r attributes are validated at compile time not dueing newInstance.

<= blockquote type=3D"cite">

=E2=80=94 Rob
= --Apple-Mail-9296EB00-647F-4919-B94A-7AC00B391CBA--