3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php public function getMeat(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.4.0 - 5.5.3
Parse error: syntax error, unexpected 'public' (T_PUBLIC) in /in/JAiTm on line 5
Process exited with code 255.
Output for 5.3.0 - 5.3.27
Parse error: syntax error, unexpected T_PUBLIC in /in/JAiTm on line 5
Process exited with code 255.