<?php
final class MyApp\Tests\MyTest extends PHPUnit\Framework\TestCase
{
    protected $logFile;

    protected function setUp(): void
    {
        $this->logFile = fopen('/tmp/logfile', 'w');
    }

    *#[\Override]*
    protected function *tearDown()*: void
    {
        fclose($this->logFile);
        unlink('/tmp/logfile');
    }
}
?>


If this attribute is added to a method, PHP validates that a method with the same name exists in a parent class or any of the implemented interfaces.