La classe Override

(PHP 8 >= 8.3.0)

Introduction

Synopsis de la classe

final class Override {
/* Méthodes */
public __construct()
}

Exemples

<?php

class Base {
protected function
foo(): void {}
}

final class
Extended extends Base {
#[
\Override]
protected function
boo(): void {}
}

?>

Résultat de l'exemple ci-dessus en PHP 8.3 est similaire à :

Fatal error: Extended::boo() has #[\Override] attribute, but no matching parent method exists

Sommaire

add a note add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top