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); print_r($newArray); foreach($arr as $key => &$val) { if(!in_array($val['Productname'],$arr)) { foreach($newArray as $v) { if($v !== $val) { $newArray[] = $val; } } } } print_r($newArray);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => Array ( [status] => OK [Productname] => test1 ) [2] => Array ( [status] => OK [Productname] => test2 ) ) Array ( [0] => Array ( [status] => OK [Productname] => test1 ) [2] => Array ( [status] => OK [Productname] => test2 ) [4] => Array ( [status] => OK [Productname] => test1 ) [5] => Array ( [status] => OK [Productname] => test1 ) [6] => Array ( [status] => OK [Productname] => test2 ) [7] => Array ( [status] => OK [Productname] => test2 ) [8] => Array ( [status] => OK [Productname] => test2 ) [9] => Array ( [status] => OK [Productname] => test2 ) [10] => Array ( [status] => OK [Productname] => test2 ) [11] => Array ( [status] => OK [Productname] => test2 ) )

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
35.98 ms | 403 KiB | 8 Q