3v4l.org

run code in 300+ PHP versions simultaneously
<?php function test(): void { return "test\n"; } // This currently gives an error, but you propose that it // would change to set $val to null? $val = test(); var_dump($val);
Output for 8.2.0 - 8.2.28, 8.3.0 - 8.3.21, 8.4.1 - 8.4.7
Fatal error: A void function must not return a value in /in/7dtYH on line 3
Process exited with code 255.

preferences:
153.08 ms | 966 KiB | 7 Q