3v4l.org

run code in 300+ PHP versions simultaneously
<?php function loop_epilogue():void { echo "terminating loop\n"; return; } function loop_iter() { echo "iteration\n"; } $x = 1; for ( FALSE; ( ( $x-- >= 1 ) || ( loop_epilogue() ) ); loop_iter() );
Output for 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.7
iteration terminating loop
Output for 7.0.0 - 7.0.33
iteration terminating loop Fatal error: Uncaught TypeError: Return value of loop_epilogue() must be an instance of void, none returned in /in/MfICN:3 Stack trace: #0 /in/MfICN(9): loop_epilogue() #1 {main} thrown in /in/MfICN on line 3
Process exited with code 255.
Output for 5.6.0 - 5.6.40
Parse error: syntax error, unexpected ':', expecting '{' in /in/MfICN on line 3
Process exited with code 255.

preferences:
234.75 ms | 401 KiB | 292 Q