3v4l.org

run code in 300+ PHP versions simultaneously
<?php function foo($int): ?int { if (!is_int($int)) { return; } return $int; } foo(12);
Output for 7.3.0 - 7.3.30, 7.4.0 - 7.4.23, 8.0.0 - 8.0.10
Fatal error: A function with return type must return a value (did you mean "return null;" instead of "return;"?) in /in/bK7Vt on line 5
Process exited with code 255.

preferences:
161.47 ms | 998 KiB | 7 Q