<?php declare(strict_types=1); error_reporting(E_ALL); interface bar { public function test(): string|null; } class foo implements bar { public function test(): string { echo "return __CLASS__" . PHP_EOL; return __CLASS__; } } class foobar extends foo { public function test(): never { echo "exit 0" . PHP_EOL; exit(0); } } (new foo())->test(); (new foobar())->test();
You have javascript disabled. You will not be able to edit any code.