Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:112015 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 65602 invoked from network); 6 Oct 2020 15:41:13 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 6 Oct 2020 15:41:13 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id CC2881804AA for ; Tue, 6 Oct 2020 07:54:35 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-lj1-f181.google.com (mail-lj1-f181.google.com [209.85.208.181]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 6 Oct 2020 07:54:34 -0700 (PDT) Received: by mail-lj1-f181.google.com with SMTP id a4so6702862lji.12 for ; Tue, 06 Oct 2020 07:54:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=UwlW/+6Qg4o1VSgWVTw1GONwHbDDWge/ohFdpntGk5g=; b=QZrR2/u6wssEbnAEILbzS4ewrKa08G/fclAZ7vduFvs/k2za+Pskc0xaMEoAP4MrmS oJISe/QPgn1bCfRoer9ptAeYd60e1k+VQjEBOuvKL9/P0PVZaK1E1B0J9FottT+a9IR5 lYl2wh448B/4EZsCIHDlGOyvRbRQQIQ1iJ9IYZygX6p1+aEz1wnBX58O7Y5q2XLwIbLZ Ofe18B0nwatGZiuGlI7042494Q3iYcSlCwkGP8Jh7KhsXC2R0PxR+ikoEzOmbg2WPgjX rOgpeNGKGrGm+FNlf0JX95r4M8wUpLc18qA+eBJGItiEYqSQAI0202OLBSsuAtmCPstu trmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=UwlW/+6Qg4o1VSgWVTw1GONwHbDDWge/ohFdpntGk5g=; b=UdQ2Hz+R1mdjkjIoAGbZrtIZtn+H/f4MFQPJ4Z9KiHE9cTna8SkCSKPLp8QVpoAUZr ksfA/Xh0ABm/4D+pXOCaTzazdxmuzE+e9Vso1pDvaEWXoSRXAq7x1GA7zL6ODKbIhpg9 isV7qASUCNXTsD9B2hrMgLxJ4DHyfvEfAaqqJsdWYJs0Vwio4T0zHD8IhRC1ZcVz4BDA 1OZMndU84zXUDFEwpy+RO32bQ7wUrdUnhEdy3eHxIh9dy8LBNxwoEoMdH54Kdad0t5Xo IvAC1mY2JEWLo60JTQ6CKp4hr1l61Lgj9p9tOFULQybwc9jlqPGDT9hZ09JUEppfZt40 vr1w== X-Gm-Message-State: AOAM530jvKxrnoFQchkzoMwcCkJRAvD3NmYsDxLWga81ADNzwpRBfd5O AN1QL7IGDQ/uirMF9mmh2q6JRup58N8YDeoA7Fezpz5WS8RGFg== X-Google-Smtp-Source: ABdhPJy4koE2OKSy49TzsnIexGjpuwm3QJu9o4XcR5E36uUNUeb37H9cZlC+NRx2F/GCWGtlKK+6EZ65IFh6i1VYd3Q= X-Received: by 2002:a2e:b0c1:: with SMTP id g1mr2166756ljl.30.1601996071492; Tue, 06 Oct 2020 07:54:31 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Tue, 6 Oct 2020 16:54:15 +0200 Message-ID: To: PHP internals , Benjamin Eberlei Content-Type: multipart/alternative; boundary="000000000000c5e24505b101c6d0" Subject: Re: Attributes and constructor property promotion From: nikita.ppv@gmail.com (Nikita Popov) --000000000000c5e24505b101c6d0 Content-Type: text/plain; charset="UTF-8" On Mon, Sep 28, 2020 at 12:36 PM Nikita Popov wrote: > Hi internals, > > When the constructor property promotion landed, the question of how it > interacts with attributes on promoted properties did not get fully > resolved. See https://wiki.php.net/rfc/constructor_promotion#attributes > for what the issue is. > > The behavior that landed was to apply the attribute is applied to both the > parameter and the property. However, this was with the understanding that > we may have to adjust the behavior later, in particular depending on how > the whole "attribute target validation" turns out. The way it is now, using > a property-only attribute on a promoted parameter may result in spurious > validation errors. > > I wanted to bring up this topic now to make sure it's not forgotten... I > still don't really know what the best behavior here is. > > Regards, > Nikita > I want to bump this topic, we should resolve this one way or another soon. My two proposals are: https://github.com/php/php-src/pull/6244: Suppress target validation errors for promoted properties (for property/parameter targets, the rest gets validated as usual). https://github.com/php/php-src/pull/6285: Forbid use of attributes on promoted properties altogether, punting on making a decision here. Regards, Nikita --000000000000c5e24505b101c6d0--