3v4l.org

run code in 300+ PHP versions simultaneously
<?php $getMeat = function(array $foods) { if (!isset($foods['meat']) { throw new Exception('There is no meat in this pie'); } $meatCount = count($foods['meats']); if($meatCount < 1) { throw new Exception('Where did all the meat go!?'); } var_dump($foods); $i = 0; $j = 1; while($i < $meatCount) { if ($foods['meats'][$i] < $foods['meats'][$j]) { $tempMeat = $foods['meats'][$i]; $foods['meats'][$i] = $foods['meats'][$j]; $foods['meats'][$j] = $tempMeat; } $i++; $j++; } var_dump($foods); }
Output for 5.3.0 - 5.3.27, 5.4.0 - 5.4.19
Parse error: syntax error, unexpected '{' in /in/kLoJi on line 7
Process exited with code 255.

preferences:
187.39 ms | 1387 KiB | 55 Q