3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $arr = array( array('idproduct' => 1, 'amount' => 5), array('idproduct' => 2, 'amount' => 10), array('idproduct' => 3, 'amount' => 11), array('idproduct' => 4, 'amount' => 5) ); addOrOverride($arr, array('idproduct' => 4, 'amount' => 5)); function addOrOverride($arr, $newItem) { $filtered = array_filter(function($item) { $item['idproduct'] != $newItem['idproduct']; }, $arr) if($filtered) die('exists'); }
Output for hhvm-3.10.0

Process exited with code 153.
Output for 5.4.0 - 5.4.27
Parse error: syntax error, unexpected 'if' (T_IF) in /in/A1K09 on line 16
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_IF in /in/A1K09 on line 16
Process exited with code 255.