3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array ('1' => (object)array( 'id' => 225, 'user_id' => 1, 'name' => 'Blue Quilted Leather Jacket by Minusey - $499' ), '2' => (object)array( 'id' => 222, 'user_id' => 1, 'name' => 'Darling New Bathtub by Duravit - $6300' ), '3' => (object)array( 'id' => 222, 'user_id' => 1, 'name' => 'Darling New Bathtub by Duravit - $6300' ) ); //print_r(array_column((array)$array, 'id')); $arr_new = array(); $arr_temp_ids = array(); foreach($array as $key=>$arr_obj) { $arr_val = get_object_vars($arr_obj); if(!isset($arr_temp_ids[$arr_val['id']])) { $arr_new[] = $arr_obj; $arr_temp_ids[$arr_val['id']] = true; } } var_dump($arr_new);
Output for git.master, git.master_jit, rfc.property-hooks
array(2) { [0]=> object(stdClass)#1 (3) { ["id"]=> int(225) ["user_id"]=> int(1) ["name"]=> string(45) "Blue Quilted Leather Jacket by Minusey - $499" } [1]=> object(stdClass)#2 (3) { ["id"]=> int(222) ["user_id"]=> int(1) ["name"]=> string(38) "Darling New Bathtub by Duravit - $6300" } }

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:
39.59 ms | 402 KiB | 8 Q