3v4l.org

run code in 300+ PHP versions simultaneously
<?php $p = array( 1, 2, 3, 4); foreach ($p as $ID) { $arr_result = array(); //Create arr_result array # code that sets $arr_result to array(100, 200, 300, 400) $count = count($arr_result); //Count how many IDs there are if($count <= 1) { echo "Only one ID"; unset($GLOBALS['arr_result']); } if($count > 1) { foreach ($arr_result as $checkid) { #do stuff } $count = 0; $arr_result = null; $checkid = null; } ?>
Output for 5.4.0 - 5.4.45, 5.5.24 - 5.5.30, 5.6.8 - 5.6.14
Parse error: syntax error, unexpected end of file in /in/qt7GE on line 29
Process exited with code 255.

preferences:
151.13 ms | 1327 KiB | 6 Q