3v4l.org

run code in 300+ PHP versions simultaneously
<?php function test(): void { print "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.1.34, 8.2.0 - 8.2.30, 8.3.0 - 8.3.30, 8.4.1 - 8.4.18, 8.5.0 - 8.5.3
test NULL

preferences:
51.16 ms | 840 KiB | 4 Q