Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:112868 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 78384 invoked from network); 13 Jan 2021 13:05:51 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 13 Jan 2021 13:05:51 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 0310E1804DD for ; Wed, 13 Jan 2021 04:44:00 -0800 (PST) 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.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,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-wr1-f41.google.com (mail-wr1-f41.google.com [209.85.221.41]) (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, 13 Jan 2021 04:43:58 -0800 (PST) Received: by mail-wr1-f41.google.com with SMTP id 91so1971707wrj.7 for ; Wed, 13 Jan 2021 04:43:58 -0800 (PST) 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=5fARVB/xZD7KQktD1b5EVG9Bo4OC/P/HHRCtyY/y/co=; b=ke5Wn7Xn2XeNZB1iNJGt9ch0SMVcpcNAH5iFNvKlncz9OtAegZE4gyP7myUWO9Dol5 rgKjghQntErvUzS7PevpFbHPgmQaamqdskugtxReiN7KuzLPcpyifoGAaQ2LgVO9Bay9 EzscVyk4H8LEyy4vtxDtW65mvlwLWEtEjDugdcKZdtYS4ylXtzrThlzikMJOyTq9954K cWK9nWvlPRc/qyXYZA0pn3JPC5p1HIgYvQE344v9mDaoTg4cLYYUsNdN4njwWPaHC1u3 /J1XVlHduLPASm+x8nE/w8PpZ1X3c4burStb386l4XESuU6ckgVQcF0BpL0IKLDrTITk 6mgw== 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=5fARVB/xZD7KQktD1b5EVG9Bo4OC/P/HHRCtyY/y/co=; b=GOsHUvpPi40UIDkfngbcnm1D3l0m+TLEH+3Ut9hIr2K/S7JVXXLtnBMV5ATyh5VR+g vZoOKuLTT7fcHtWGAUzcJXzM4iFgnIbS3MEGiX5JNAOrLbppmO9+bpvgZVIDhvQcWvoB CWEqLzfLXptWlUslil8rgPhSTOGyE4fQDM3SMRsdy1Y9KVz7A2nkngiV4Q/qFUSQnWS5 Ll9kpOAMKGjCaSBuWSF9gvvgWo9/JGrH+LQOalnvaBXknwOVnUyF4TdNdlavbMwgxnpC s6+xYkxpyxGZNIR/RjSUYw68pjWeR1mPH/vBMsiWqZBBu0PRnHwgHD7wxT7KsJk0qhxX 4U/A== X-Gm-Message-State: AOAM5311LhMxhZ5fOMDWqResfUlQstsLjvf12yWow251Syl4Ot5cOwnY gGJ27UYsklusYQ2bEUJSe3T3t0K5J31127wbZ3BOH9k6TN7Y5Q== X-Google-Smtp-Source: ABdhPJxG5W61IvvFrAajvPMAQr5J5OxEk6yK24e2gWpDxUB+1MCMr37uaXvec2C9z9KzGQjlQmiYqbseyoS3yzgfnlM= X-Received: by 2002:adf:e406:: with SMTP id g6mr2447516wrm.255.1610541833910; Wed, 13 Jan 2021 04:43:53 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: Date: Wed, 13 Jan 2021 13:43:42 +0100 Message-ID: To: Brent Roose Cc: PHP Internals Content-Type: multipart/alternative; boundary="000000000000e80e9705b8c77d43" Subject: Re: [PHP-DEV] #[Deprecated] Attribute From: kontakt@beberlei.de (Benjamin Eberlei) --000000000000e80e9705b8c77d43 Content-Type: text/plain; charset="UTF-8" On Wed, Jan 13, 2021 at 1:05 PM Brent Roose wrote: > Hi Sara > > > On 22 Dec 2020, at 19:54, Sara Golemon wrote: > > > > On Tue, Dec 22, 2020 at 12:35 PM Nicolas Grekas < > > nicolas.grekas+php@gmail.com> wrote: > > > >> It would be great to allow adding this attribute on classes. What about > >> allowing it right now and not bind it to any runtime side-effect? That > >> would allow static analyzers to do their job. Same for consts and > >> properties by the way. > >> > >> Also, it would be very useful to add named parameters to the attribute, > >> namely: "package" (the name of the package that declares the > deprecation) > >> and "version" (the version of that package that introduced the > >> deprecation), next to the message. > >> > >> This is critical info when building reports of deprecations. > >> > >> > > You could do that now with a polyfill from userspace. If the annotation > > need not have an effect, then it's just any other userspace > implementation. > > The difference is that PHP core has the ability to force standarization. > There's already JetBrains' implementation of #[Deprecated], which Psalm and > PhpStan also support, but it's not a real standard. Maybe the FIG would one > day step in to decide these kinds of things, but the reality is that many > major frameworks don't follow FIG as closely as they used to. I think > there's value in adding attributes in the core, with the goal only being > static analysis. It'll allow for consistency and that's a valuable thing. > I want to keep #[Deprecated] on other elements than functions / methods out of this RFC, because they require entirely different implementation approaches. We identified in the PR already that this should at some point be standardized in core, because internal attributes will currently not be able to support extension through inheritance by userland for implementation reasons. My next RFC update will reflect this future scope. > > > > > -Sara > > > Kind regards > Brent > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: https://www.php.net/unsub.php > > --000000000000e80e9705b8c77d43--