Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:112021 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 45657 invoked from network); 7 Oct 2020 08:48:31 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 7 Oct 2020 08:48:31 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 96A111804C0 for ; Wed, 7 Oct 2020 01:02:04 -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-f171.google.com (mail-lj1-f171.google.com [209.85.208.171]) (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 ; Wed, 7 Oct 2020 01:02:04 -0700 (PDT) Received: by mail-lj1-f171.google.com with SMTP id r24so1038869ljm.3 for ; Wed, 07 Oct 2020 01:02:04 -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 :cc; bh=PdN+l8cULEgd9Y1ObV1gP9ddc9SrTGipil79b01a/PU=; b=UBhzRiV1+HqpiqE77DCSelwRxtLIBNFPiTxvL8RoveSXp3ALenYeN+OdaNk7hEHZmO vmBgflpvr4oKXcCC3AGtho7/PHRViivTIdNdbmKO+ImW5CjiYQswTgkilRGdg9pqarl3 s8YMiTCsSye+WOpBLaPkqePcok9Yv6ctcCJzdY/e5sn9Z24SCKXY+5bl6WHK3uiRpMDl ohBwOue7472znCwQfd41eNJVQOrNhFkClxl3m0C/CjM77etP+M474V25RsSM6YuVM+Q5 4aWbP8X5AKB7BLx+j2NCYqS89pU67cFMcKm7dvdI0V4LqHU0F9wjmud4T9nP7EWPtmV9 bW1A== 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=PdN+l8cULEgd9Y1ObV1gP9ddc9SrTGipil79b01a/PU=; b=ocrHcH9mCwEqPOXvu9Jw9y9pHGy1ZjeytOok8B3r1aTzZDB9uWbRsRlr2NQet1kF27 w9ouclvJ1zNiA8XoWPYypNayKWmAMM+8zi6QHsZZgVQDmlblqXCGPdU6N+fEXrfGmdA1 4PbXRTpn8lv6+M3qEAggh119up5BTh5Yduem9UcB0rpOR+/TKwKt0XbbZEZwoAdyq80J F3ljIr5YnYM4QZO7zdyw9irC+uTorRHnTDmUjNjwYRdOqBghvNkgfw6Do3oBnE5cMZsc Vp1LdhlwUM2uUPC/4YBiSI0XG74CiRfYiInvB4tvW6P5Xd/hcjdhRP8J3944o2Q/MWxi Lntw== X-Gm-Message-State: AOAM532lRBEDv9s84kvxn+pavvfm9N3lBPdf1uMZojF0eCS//53vMkj4 9IlLWLTKVZCa49VXHXqyzaXXsP7nwKIoHQawkTM= X-Google-Smtp-Source: ABdhPJzNnSmnZ39se3NqmuWOgJdi6M1Fjexu+X9QCMrs5hRLNA2PYkUnLAF3T8By2ny9kvD/3fgtcIsbth01K8/h3Fw= X-Received: by 2002:a05:651c:1056:: with SMTP id x22mr795944ljm.81.1602057720688; Wed, 07 Oct 2020 01:02:00 -0700 (PDT) MIME-Version: 1.0 References: <33f82702-6126-fa36-48d6-71487cae1b72@gmx.net> In-Reply-To: Date: Wed, 7 Oct 2020 10:01:44 +0200 Message-ID: To: Rowan Tommins Cc: PHP internals Content-Type: multipart/alternative; boundary="00000000000059f97f05b11021c5" Subject: Re: [PHP-DEV] Attributes and constructor property promotion From: nikita.ppv@gmail.com (Nikita Popov) --00000000000059f97f05b11021c5 Content-Type: text/plain; charset="UTF-8" On Tue, Oct 6, 2020 at 6:59 PM Rowan Tommins wrote: > On Tue, 6 Oct 2020 at 17:20, Andreas Leathley wrote: > > > From my understanding suppressing the validation errors in this > > particular case would be a good solution, or are there any serious > > downsides to that? > > > > > The downside presumably is that a library author could implement an > attribute with a property-only restriction, and therefore write code > handling parameter attributes with the assumption that that attribute won't > be present. If a consumer of the library makes use of constructor property > promotion, that assumption can be violated. I can't quite picture what that > code would look like, though, since it's always necessary to filter the > list of attributes to exclude those from other libraries. > Yeah, this is my own view as well. If an attribute appears in an unexpected place, you'd just ignore it the same way you ignore all attributes you do not "own". For manual implementations, you wouldn't even notice (because for a property-only attribute, you'd only be looking at properties, duh) and general attribute handling libraries can easily accommodate this case (if it doesn't just happen automatically). Regards, Nikita --00000000000059f97f05b11021c5--