3v4l.org

run code in 500+ PHP versions simultaneously
<?php interface I { function foo(): A; } class X implements i { function foo() : A { // return type is not useful here throw new Exception(''); // PHP complains that a value must be returned return; // PHP won't complain until execution time return 1; } }
Output for 8.5.6
Fatal error: A method with return type must return a value in /in/Ic9jV on line 14 Stack trace: #0 {main}
Process exited with code 255.

preferences:
44.87 ms | 480 KiB | 3 Q