Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:127305 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 lists.php.net (Postfix) with ESMTPS id 9F7ED1A00BC for ; Wed, 7 May 2025 17:50:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1746640112; bh=+KK5o/N2sGsqhy3yvj7iTekJWBaw+lk0fUrHJ3CnsGA=; h=From:Date:Subject:To:From; b=H7VsNKPalmTzv1vfMWQv5lGIQAq3BslsdSYaFCXvWgGHRSbr6NE0zui0sV2k2wljw WInAjA62n60w5kixgvAD9z7pWSWFhzWuTUD8Wx5Gkw70X2KS0Q1xX2gISEPzlzT85N 4y9e9iurI4/kq0F41ffRTs95PfVJaWM0+2R4k9umlCKjIA/2WGd3MP/g3hG8FKnqzL M8dJD1iASA5NbZ+5VhMTR2l8iolpeQyRMDY1jme8dSqRsqrKTAS5P7SCLbA32NOlvS 8M+YZmqas6sp87q27XmW+jhrW/1a4aKTzAnRrG2Ky//cV/I/qxVHLpcruKfFdZqeGt 5WCzN2Cq57TSw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id CA1BA180077 for ; Wed, 7 May 2025 17:48:31 +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.7 required=5.0 tests=BAYES_05,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 autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: Error (Cannot connect to unix socket '/var/run/clamav/clamd.ctl': connect: Connection refused) X-Envelope-From: Received: from mail-vs1-f51.google.com (mail-vs1-f51.google.com [209.85.217.51]) (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, 7 May 2025 17:48:31 +0000 (UTC) Received: by mail-vs1-f51.google.com with SMTP id ada2fe7eead31-4c30a4bcceeso38222137.3 for ; Wed, 07 May 2025 10:50:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1746640244; x=1747245044; darn=lists.php.net; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=+KK5o/N2sGsqhy3yvj7iTekJWBaw+lk0fUrHJ3CnsGA=; b=OIBG4P3vh4oh1hcXix0f2x3EcWgiDaJoYAaCLsyYtNRPGvQ9UkeA33lEMoWTiggAJn BA982vL6W8mA49u+9aKvjs5SfnZeyqScufCtu2a5RYTf+otzSABkO3rSzpkvxcnH01nX KLJjW6ZQuZ2zQ4SSLgOIV3eSFhqJDiqUahPy7mpPQpWw3SmZ1NpRdIobv1FSVu+E5AGb fHCACdHyCodZPb0O1ZYTS78FzMIS571OGleECUyLjIn3zl5qYV4rkgooAQtJI6knVwLv sFx8V81gbxmIk0vuRfWMqiZk14KKjDM3pHeihUF2/q5uE6CTnbwQVvM0Zw203uYv8NNS uGng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1746640244; x=1747245044; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=+KK5o/N2sGsqhy3yvj7iTekJWBaw+lk0fUrHJ3CnsGA=; b=q7te86S3oguq4hA+mu+2fxuReTiqOiE/KcH6wASBWi3I1yqgImWm8jHwVwynsYgcXY uQtR9j5e0A/3AAkvfw+xXkO5s3QxktnrcSgfIWm80RVsOsAjHCSyxtLu06AWDKSX3W6E RWIqjZAbhe6V5eGh9gqdlNWMVdfBZvavxsm9q3g+mzkECasGgcevu2tW8yLtErdp+T1I Y6MOjAeRUuKvg3YNIH+MDH9ug64ieJIyww0s6BeuG1yAlmnfu3F1wDvrV8XP2jui+VoW eqgqBeY9m4Hxvzfe/7YObQZYx1tIllxTyISI5SVvhGy46nueG7KrJ9OuGL1F3q3kC+59 X3xg== X-Gm-Message-State: AOJu0YySuF7g5vfNQFUPiOxUnuh4C0ghWaO437reUqNxc4CaUHTwliVp eKGD/VGEj21F4XKeiBq594eB+ptIDuo9Z/Z3mcUFtstIkZsTJVECAA+c+oUm2F9mbejgqIIkiBa r9dwchOYg0I3mnW4HwWqC6RlhQG9ElaKX X-Gm-Gg: ASbGncvjQOS2q9f8lCaZUcL93KXXbWatNIXa8XsojQJvPbFPGu0CbSpwHl/7vUIDEGs QOfNWacMnAthTgfC9wHjMVGhmWOwb/pSZRbm6zF18FKp8qQHVoTsh83KC62M7Kj+dODOigmP78c +e6icZpM1VKwn0Holgxb0XXw1yq+baSCtZ12oPV7HV1N4fLk2WfHf/uA== X-Google-Smtp-Source: AGHT+IEE4ju1VwgjyLA73nRdQZl4EZ7oxjlzOeXrGNiZBw/E+wBljkxABx2O5iiHGEukzeCN/lpeYN+H4hQy4uHA2tQ= X-Received: by 2002:a05:6102:5711:b0:4c2:20d3:a125 with SMTP id ada2fe7eead31-4ddacf6dc93mr534445137.8.1746640244269; Wed, 07 May 2025 10:50:44 -0700 (PDT) Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 Date: Wed, 7 May 2025 10:50:16 -0700 X-Gm-Features: ATxdqUE6cf7nV3JpaL24a7Iil2iXgmL64GC6dIGN3eiHK1mM7WNYN3jZPoG-4JY Message-ID: Subject: [PHP-DEV] Initial discussion - more deprecation options To: php internals Content-Type: multipart/alternative; boundary="0000000000004f695d06348f5fb6" From: daniel.e.scherzer@gmail.com (Daniel Scherzer) --0000000000004f695d06348f5fb6 Content-Type: text/plain; charset="UTF-8" Hi internals I'd like to start off some preliminary discussion about expanding the places that `#[\Deprecated]` can be used, and more widely how userland code can have the engine trigger deprecation warnings (rather than just manually calling `trigger_error()`). This is intended to be a follow-up to the addition of attributes on constants - it is now possible to use attributes so that the engine emits warnings when * Calling a function or method * Accessing a class constant * Accessing a global constant My inspiration is MediaWiki's "Stable Interface Policy"[1] - there are some things that MediaWiki (and other libraries) may want to deprecate, but that do not trigger deprecation warnings, or require work-arounds to trigger them manually with `trigger_error()`. Specifically, I want to get the community's thoughts on adding ways to * Deprecate `use`ing traits * Deprecate extending a class * Deprecate overriding a method * Deprecate implementing an interface * Deprecate accessing a public/protected property * Deprecate class aliases (maybe a new way to declare aliases with `#[\ClassAlias]`?) Having learned my lesson from the never-parameters RFC, I want to get a sense of support/opposition before spending time on the implementations. I also want a sense of which parts would need individual RFCs, and if those RFCs would be welcomed without first providing an implementation. - Daniel [1] https://www.mediawiki.org/wiki/Stable_interface_policy --0000000000004f695d06348f5fb6 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi internals

I'd like to star= t off some preliminary discussion about expanding the places
that `#[\De= precated]` can be used, and more widely how userland code can have
the e= ngine trigger deprecation warnings (rather than just manually calling
`t= rigger_error()`). This is intended to be a follow-up to the addition of
= attributes on constants - it is now possible to use attributes so that the<= br>engine emits warnings when

* Calling a function or method
* Ac= cessing a class constant
* Accessing a global constant

My inspira= tion is MediaWiki's "Stable Interface Policy"[1] - there are = some
things that MediaWiki (and other libraries) may want to deprecate, = but that do
not trigger deprecation warnings, or require work-arounds to= trigger them
manually with `trigger_error()`. Specifically, I want to g= et the community's
thoughts on adding ways to

* Deprecate `us= e`ing traits
* Deprecate extending a class
* Deprecate overriding a m= ethod
* Deprecate implementing an interface
* Deprecate accessing a p= ublic/protected property
* Deprecate class aliases (maybe a new way to d= eclare aliases with
`#[\ClassAlias]`?)

Having learned my lesson f= rom the never-parameters RFC, I want to get a sense
of support/oppositio= n before spending time on the implementations. I also want
a sense of wh= ich parts would need individual RFCs, and if those RFCs would be
welcome= d without first providing an implementation.

--0000000000004f695d06348f5fb6--