3v4l.org

run code in 300+ PHP versions simultaneously
<?php $tries = 10; foreach($array as $key => $value) { while ($tries > 0) { $tries--; } }
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.29, 8.2.0 - 8.2.20, 8.3.0 - 8.3.8
Warning: Undefined variable $array in /in/rktvm on line 7 Warning: foreach() argument must be of type array|object, null given in /in/rktvm on line 7
Output for 7.1.0 - 7.1.25, 7.2.0 - 7.2.33, 7.3.0 - 7.3.31, 7.4.0 - 7.4.33
Notice: Undefined variable: array in /in/rktvm on line 7 Warning: Invalid argument supplied for foreach() in /in/rktvm on line 7
Output for 7.3.32 - 7.3.33
Warning: Invalid argument supplied for foreach() in /in/rktvm on line 7

preferences:
154.3 ms | 402 KiB | 177 Q