Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:123200 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 qa.php.net (Postfix) with ESMTPS id A1C3B1A009C for ; Wed, 24 Apr 2024 13:57:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1713967107; bh=VZXOFgkKyhycag/T5liieej6wmmxEvpnwSA6AgUgon4=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=QPFAJd4lo4fik9Hbg36mNSr/LYN6wKZUqAHxXjsNnp28nbXUQw6aoaQx0cvEZ1GF/ BZ9aQduw11LGqhVasEpX0nzoUVgVWdMrfDwJ+z7CQJpOE5MmkfG8gAjDS78hib4z+Q ZL/pCFjDx8waKaaTV3CsUz4VqM3RFBGc2TPos3sxujnjD5e/HmuBKmyvfPIPYuzY5P HeKZixkcW52k63VUR7mwLRdSNgz88+5d8Qt3KRAGngK2mK2kdnuuocjsTfoEgiw02T Ed1RGkXzyQXepe1UiOENFR/YZkX+C7V86MzJS+TmKhl5JhJCTvOP9661tPbTGcTm0V 8c+78L7LEMIsw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 037D3180004 for ; Wed, 24 Apr 2024 13:58:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=0.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,FREEMAIL_FROM, HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from mail-lj1-f179.google.com (mail-lj1-f179.google.com [209.85.208.179]) (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, 24 Apr 2024 13:58:26 +0000 (UTC) Received: by mail-lj1-f179.google.com with SMTP id 38308e7fff4ca-2dac77cdf43so89056511fa.2 for ; Wed, 24 Apr 2024 06:57:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713967064; x=1714571864; darn=lists.php.net; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=d6hFum6SRHrc0XYsYNZexxaCcIUi5vqgblanjNgDPq4=; b=jNV7yikesyKzDaSSRIaiF3kv6iNacF+18uhCxrm8//mTQp7QLGQTGRmlij9pohQrFk 1QuTa8Ejt7TRMMJrfHeQ9FLE3bX+fAuEI6Yrd85jVY6HoxzsUUboyKik7CAYaTdFJW8h hP5GDiVV6JIoB5uJYxjrrPip4XGz5f2C95zTbD6JgDkugDWJBWJkn2mjLJp64CzLqzcB V6nDR9kPk2LW3JghEu6RvFf7iJ9nhZgajfO7DX/ZekiP6QigcRkaTV27/0u+mQkr4jPA 8nD7xTiXWFcKP5gNl2Zd551nvgOUivoUYLx7eQbz8kBbY/7kKDmR0PZ60LBCqCjtMKCv bagw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713967064; x=1714571864; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=d6hFum6SRHrc0XYsYNZexxaCcIUi5vqgblanjNgDPq4=; b=ss2VV5OIhjTmmBTTijhOaGbipA+2mVZfPUj9ZChncj2ukrlDZ2O8SOFsmGTsVzAsFU Zo0YOLWbYYzKE/oFNZTMlVYpVzkh+hh6W4Zs3yC1Wi317yMnH5u/iCHLB4HgJGOsIkx0 wVZDk1voxVi3skjCBUdJNoN6Rl1UdBTkygR9gjaBhT875uZoZM+dbPlmngxNojCU44VR 2D+i3TSCLbhEeb0emuimg2V2aLdrYkGcyd1mZ8OZuf9Peh/XtQrLex4dIe4hfbI4pmhL L7TDlineVSuI6LFAVky6ivMdFD3fLf9S/FIC44z/en2RL4/ZU+JUTfXp41PCYafHTIKq Ovzg== X-Gm-Message-State: AOJu0YxhL8RYZKq3jbRgh26b6gY5OmaWbRI0UQfT88UhP3bL28XP+Bgr V1B2wH+fGtGzdjOiLSpVMbmlXQLhl0wYul4zzPDY9m64u5jHyijN+eWdN/h32rGBtG+tggJzjWC lEsVJQMGgueXOpfqrQlEBDbbavGc= X-Google-Smtp-Source: AGHT+IFvngzTDIBRnLrgbyUBrDV/4RdR4NmzBXHGy0yHhhKKNL036s7pf4aUSbeoreCJAqZDpelVDmUiHXx1wU+Wqr4= X-Received: by 2002:a2e:860a:0:b0:2dc:b467:cb32 with SMTP id a10-20020a2e860a000000b002dcb467cb32mr1613007lji.14.1713967063896; Wed, 24 Apr 2024 06:57:43 -0700 (PDT) Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net MIME-Version: 1.0 References: In-Reply-To: Date: Wed, 24 Apr 2024 15:57:32 +0200 Message-ID: Subject: Re: [PHP-DEV] [RFC] [Discussion] #[\Deprecated] attribute again v1.3 To: =?UTF-8?Q?Benjamin_Au=C3=9Fenhofer?= Cc: PHP Internals , "tim@tideways-gmbh.com" Content-Type: multipart/alternative; boundary="000000000000001a240616d80e7c" From: nicolas.grekas+php@gmail.com (Nicolas Grekas) --000000000000001a240616d80e7c Content-Type: text/plain; charset="UTF-8" Hi Benjamin, My PR for #[\Deprecated] attribute was in hibernation for a long while now > and after some off-list discussion a few weeks ago I have decided to > revisit it and asked Tim to help me out with the work. > > Tim has cleaned up the PR quite a bit and also worked in additional > features such as #[Deprecated] support in stub generation. > > While there are still some small todos, at this point we want to restart > the discussion about the RFC for inclusion in 8.4: > > RFC: https://wiki.php.net/rfc/deprecated_attribute > PR: https://github.com/php/php-src/pull/11293 > Old discussion: https://externals.io/message/112554#112554 > > Let me know about your questions and feedback. > Thanks for the RFC. While I'd like to be able to replace as many annotations as possible with attributes, the devil is in the details and here, I'm not sold about the details: - I concur with others about the "since" property being missing. - We'd also need a "package" property so that it's trivial to know which composer package is deprecating. - The attribute class should not be final, so that packages could subclass, e.g. to define the "since" or "package" property once for all - or to define a custom constructor, etc. - We should be able to add the attribute to a class. Yes, the "package" + "since" info can be put in the message itself, but having a structured way to declare them is critical to 1. be sure that authors don't forget to give that info and 2. build tools around that. You're saying that these are not useful because the engine wouldn't make anything useful out of e.g. "since". That's true, although I'd suggest using them to prefix the final message. If that's the policy around attributes for the engine, then I'm wondering if the attribute shouldn't live elsewhere. Or if we shouldn't discuss this policy. I also anticipate a problem with the adoption period of the attribute: in order to be sure that a call to a deprecated method will trigger a deprecation, authors will have to 1. add the attribute and 2. still call trigger_error when running on PHP < 8.next. That's a lot of boilerplate. Personally, I'm not convinced that there should be any runtime side-effects to the attribute. I'd prefer having it be just reported by reflection. Nicolas --000000000000001a240616d80e7c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Benjamin,

My PR for #[\Depr= ecated] attribute was in hibernation for a long while now and after some of= f-list discussion a few weeks ago I have decided to revisit it and asked Ti= m to help me out with the work.

Tim has cleaned up= the PR quite a bit and also worked in additional features such as #[Deprec= ated] support in stub generation.

While there are = still some small todos, at this point we want to restart the discussion abo= ut the RFC for inclusion in 8.4:


Let me know about yo= ur questions and feedback.

Than= ks for the RFC.

While I'd like to be able to r= eplace as many annotations as possible with attributes, the devil is in the= details and here, I'm not sold about the details:
  • I = concur with others about the "since" property being missing.
  • =
  • We'd also need a "package" property so that it's triv= ial to know which composer package is deprecating.
  • The attribute cl= ass should not be final, so that packages could subclass, e.g. to define th= e "since" or "package" property once for all - or to de= fine a custom constructor, etc.
  • We should be able to add the attrib= ute to a class.
Yes, the "package" + "sin= ce" info can be put in the message itself, but having a structured way= to declare them is critical to 1. be sure that authors don't forget to= give that info and 2. build tools around that.

Yo= u're saying that these are not useful because the engine wouldn't m= ake anything useful out of e.g. "since".
That's tru= e, although I'd suggest using them to prefix the final message. If that= 's the policy around attributes for the engine, then I'm wondering = if the attribute shouldn't live elsewhere. Or if we shouldn't discu= ss this policy.

I also anticipate a problem with t= he adoption period of the attribute: in order to be sure that a call to a d= eprecated method will trigger a deprecation, authors will have to 1. add th= e attribute and 2. still call trigger_error when running on PHP < 8.next= . That's a lot of boilerplate.

Personally, I&#= 39;m not convinced that there should be any runtime side-effects to the att= ribute. I'd prefer having it be just reported by reflection.
=
Nicolas



=C2=A0
--000000000000001a240616d80e7c--