<?php declare(strict_types = 1); interface SafeC { /** @throws void */ function get(): null; } class C { /** * @throws \Exception */ function get(): int { return random_int(0, 2) > 0 ? 1 : throw new \Exception("oops"); } } class CSafe1 extends C implements SafeC {}; class CSafe2 extends C implements SafeC { function get(): never { throw new \Exception("oops"); } };
You have javascript disabled. You will not be able to edit any code.