3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $itinerary = array (array('portName'=>'Day At Sea'), array('portName'=>'Moscow')); $badPorts = array('At Sea', 'Day At Sea', 'Cruising The Mediterranean Sea'); $image = ''; $image .= implode(',', array_reduce($itinerary, function ($result, $item){ if(!in_array($item['portName'], $badPorts))) $result[] = $item['portName']; //$index++; return $result; }, array())); var_dump($image);
Output for 5.3.0 - 5.4.13
Parse error: syntax error, unexpected ')' in /in/OtQPq on line 6
Process exited with code 255.