3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = array( array('status'=>'OK','Productname'=>'test1'), array('status'=>'OK','Productname'=>'test1'), array('status'=>'OK','Productname'=>'test2'), array('status'=>'OK','Productname'=>'test2') ); $notToDuplicate = array('test2'); $newArray = array_unique($arr, SORT_REGULAR); foreach($arr as $key => &$val) { if(!in_array($val['Productname'],$arr) { var_dump(array_intersect($val, $newArray); } }
Output for 5.3.0 - 5.3.28, 5.4.0 - 5.4.27
Parse error: syntax error, unexpected '{' in /in/UGQe2 on line 13
Process exited with code 255.

preferences:
191.63 ms | 1395 KiB | 64 Q