A classe Override

(PHP 8 >= 8.3.0)

Introdução

Resumo da classe

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

Exemplos

<?php

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

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

?>

A saída do exemplo acima no PHP 8.3 é semelhante a:

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

Índice

add a note add a note

User Contributed Notes

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