3v4l.org

run code in 300+ PHP versions simultaneously
<?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"); } };

preferences:
68.83 ms | 2730 KiB | 5 Q