3v4l.org

run code in 300+ PHP versions simultaneously
<?php function cont() { continue(-1); } $arr = [1,4,7,5]; $i = 0; foreach ($arr as $it) { cont(); $i++; } echo $i;
Output for 5.4.0 - 5.4.17
Fatal error: 'continue' operator accepts only positive numbers in /in/oBa5a on line 3
Process exited with code 255.
Output for 5.3.0 - 5.3.27
Parse error: syntax error, unexpected '[' in /in/oBa5a on line 6
Process exited with code 255.

preferences:
179.07 ms | 1399 KiB | 53 Q