An earlier RFC added the #[\Override] attribute for methods. You put it on a method to declare that it replaces a parent method, and if no such parent method exists, PHP stops with an error. This RFC from Jiří Pudil lets you put #[\Override] on properties too.

Why now

The original RFC left properties out on purpose, because at the time interfaces couldn't declare properties and properties had no behavior of their own. PHP 8.4 changed that. Classes and interfaces can now declare abstract properties, and property types can sometimes vary slightly in a child class. As a result, properties are a much bigger part of a class's public API than they used to be.

How it works

When you put the attribute on a property, PHP checks that a parent class or interface has a property with the same name:

class P {
    abstract public mixed $p { get; }
}

class C extends P {
    #[\Override]
    public mixed $p;
}

If there's no match, you get an error at compile time:

class C {
    #[\Override]
    public mixed $c; // Fatal error: C::$c has #[\Override] attribute, but no matching parent property exists
}

The rules match the ones for methods:

  • Public and protected parent properties count, and so do abstract ones.
  • A private parent property doesn't count, since it isn't part of the public API.
  • On a trait, the check runs in the class that uses the trait.
  • It works on anonymous classes, interfaces and promoted constructor properties.
  • Enums can't have properties, so it doesn't apply to them.

What it means for existing code

Nothing breaks, and the RFC lists no backward compatibility issues. IDEs and static analysis tools will likely add the same check for properties.

The vote

Accepted 24 to 0, clearing the two-thirds majority it needed. Voting closed on August 5, 2025, and the feature shipped in PHP 8.5.