# #[Deprecated] Attribute

- Thread: https://externals.io/message/127526
- Original archive: https://news-web.php.net/php.internals/127526
- Started by fennic log on 2025-06-01T22:31:01+00:00
- Messages: 1
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #127526 — fennic log — 2025-06-01T22:31:01+00:00

URL: https://externals.io/message/127526#127526

> > […]
> about
> > […]
> attribute,
> > […]
> deprecation)
> > […]
> implementation.
> > […]
> and
> > […]
> one
> > […]
> many
> > […]
> thing.
> > […]
> out
> > […]
>
>
> Last night, I identified a need for `#[Deprecated]` on a userland class in
> one of my libraries, but I had to settle on `@deprecated` for the widest
> range of compatibility.
>
> Has there been anymore thought on putting together an implementation for
> this? I’m happy to draft an RFC if someone is able to help with the
> implementation. I don’t understand the complexities around the
> implementation, but is this something that could make it into 8.5, provided
> an RFC vote passes?
>
> Cheers,
> Ben
>
>
I have needed this as well at work for a shared library and i'm sure many
library authors would use it too.
Current IDE's like jetbrains has support for #[Deprecated($reason,
$replacement)] which will throw warning in the IDE,
see their implementation here:
https://github.com/JetBrains/phpstorm-attributes?tab=readme-ov-file#deprecated

If this could be supported at a language level, package authors, frameworks
and internal company libraries would benefit from it.
I see no reason why anyone would be against the idea, other than pure chaos
evil.
