Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:111943 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 61709 invoked from network); 28 Sep 2020 12:45:03 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 28 Sep 2020 12:45:03 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id BF23A1804E3 for ; Mon, 28 Sep 2020 04:56:23 -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=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_NONE autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) (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 ; Mon, 28 Sep 2020 04:56:22 -0700 (PDT) Received: by mail-wm1-f46.google.com with SMTP id v12so846565wmh.3 for ; Mon, 28 Sep 2020 04:56:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=beberlei-de.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=R3JIU5ftWCqfRL/XkL3PiCr3S80ZR6vwrWAdGdqxFZo=; b=OwZMVkS/XMSsTae5sqWfb3Rbgy96EK7kNymmFPQKifLIaAUowsbWC63NymJ+J2vm/c ylJwvBhI7SYS/Fawel3T+eBSLNNhrZiogm/BiDeureVIFKb9t2G0egMp1UY1VyeBxHvK /feKY/HTwJdE+LVj1PRGFShT/kVEJex8Z5IWrq2sRvEhPQBh2qVn1EZ8REgKv4R4rZAY 9BU9pM4t41OpEpFbctU2jeYU7GQZjeYXfdr3dMjlYHQc85Db8p5JaMkQc3q7JFdB/WCK IrWhwxw5CjjrvIygtMPMi+kAOiE4fJSy4qYVp+BYorYOdbjz5kB36OOtx8/XyRdXAJLH IK0A== 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:cc; bh=R3JIU5ftWCqfRL/XkL3PiCr3S80ZR6vwrWAdGdqxFZo=; b=EIRjR1wW9bRV33PcFX63/loAwITTFl0m9nnCPSiGRKjP6NYrUXcd9Klp6IVjKl/6KQ ITUeXzsleD+sUjnvfNZGI2sIKrwBTVWTue6f0UR1EoYH5ypmawh9MKyhdNuFSnA8LkKE whAFdUoONTf05tARr1zDwAP0GoQwnDy1WhkYz6w3DrWA1mzygRx1xlGzpXYtzqws73wo 0Ea8oTQKRWTS/kVaV6Yi/MBVEfovGnz3Kh2zULaUZFcZ63q5MWLkAySg5SvLuEp2kZrk AMD8nvVVrNBuSSd22+nGVOIQIcgPFLrmMhi2JVQORv+/iav0qe2xspFDBub6miXoxUkl /K+A== X-Gm-Message-State: AOAM533tu3cugWI2qAreLNYdfqRB2rqFBx3n6JQp9yNIkGDYSvHxrM+G Y2dMHoEWn4p1RRxxDSoQDlETh2CDC71hYL1Dad1o0w== X-Google-Smtp-Source: ABdhPJxIp7jEqpA6S4cvk57UVPhlJ6w8cH9cPYOXduut6rCJ5nwiQBN1d9Tuaa0vR1mkfZjgkRHnAeUq7/m0Td6YMfM= X-Received: by 2002:a7b:c14d:: with SMTP id z13mr1234593wmi.107.1601294173920; Mon, 28 Sep 2020 04:56:13 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Mon, 28 Sep 2020 13:56:03 +0200 Message-ID: To: Nikita Popov Cc: PHP internals Content-Type: multipart/alternative; boundary="0000000000006af7f405b05e5a93" Subject: Re: Attributes and constructor property promotion From: kontakt@beberlei.de (Benjamin Eberlei) --0000000000006af7f405b05e5a93 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. > imho, we should pick the 80% use-case and advise to desugar the code if other behavior is desired. For me the 80% case is that the attribute only applies to the property, not to the parameter. > > Regards, > Nikita > --0000000000006af7f405b05e5a93--