PHP 8.4 added the #[\Deprecated] attribute for functions, methods and class constants, and PHP 8.5 extended it to global constants and traits. When your code uses something marked deprecated, PHP emits a deprecation notice. This RFC from Daniel Scherzer lets you put #[\Deprecated] on interfaces too.

How it works

When a class implements a deprecated interface, PHP emits a notice:

#[\Deprecated]
interface DemoInterface {}

class DemoClass implements DemoInterface {}

// Deprecated: Interface DemoInterface implemented by DemoClass is deprecated in %s on line %d

The same thing happens when another interface extends a deprecated one.

The RFC sets a few rules:

  • Only direct use counts. You get the notice when a class implements the interface or another interface extends it. A class that extends a parent class which implements it gets no extra notice, and neither does a class that only implements a child interface.
  • Error handlers work. Like any deprecation, you can turn the notice into an exception with set_error_handler(). If that exception isn't caught, the class fails to register, the same as when you implement something that isn't an interface.

The RFC compares this to static analysis tools. Phan, PHPStan, Mago and Psalm each warn in a slightly different set of cases when an interface has an @deprecated docblock, and the engine's rules match Phan and PHPStan.

What it means for existing code

Nothing breaks. No interfaces that ship with PHP are marked deprecated yet, so this only gives the engine a way to do it later. IDEs and static analysis tools may want to surface these notices before PHP itself does.

Where it stands

The RFC is a draft, version 0.1, dated May 10, 2026, and targets PHP 8.6. The discussion thread isn't linked yet, and no vote has happened.