The Override attributeIntroductionThis attribute is used to indicate that a method is intended to override a method of a parent class or that it implements a method defined in an interface. If no method with the same name exists in a parent class or in an implemented interface a compile-time error will be emitted. Class synopsis
final
Override
/* Methods */
public __construct()
Examples
Output of the above example in PHP 8.3 is similar to: Fatal error: Extended::boo() has #[\Override] attribute, but no matching parent method exists
|