3v4l.org

run code in 300+ PHP versions simultaneously
<?php $rates = array( array("serviceType" => 1, "unit" => "word", "unitRate" => "0.05000"), array("serviceType" => 2, "unit" => "word", "unitRate" => "0.02500"), array("serviceType" => 3, "unit" => "hour", "unitRate" => "15.0000"), array("serviceType" => 4, "unit" => "hour", "unitRate" => "15.0000"), array("serviceType" => 5, "unit" => "hour", "unitRate" => "25.0000"), array("serviceType" => 1, "unit" => "word", "unitRate" => "0.04000"), array("serviceType" => 6, "unit" => "minute", "unitRate" => "7.0000"), array("serviceType" => 7, "unit" => "minute", "unitRate" => "1.5000"), array("serviceType" => 8, "unit" => "minute", "unitRate" => "0.28330") ); foreach($rates as $rate){ $deduplicated_rates[$rate['serviceType'].$rate['unit']] = $rate; } var_dump($rates); var_dump(array_values($deduplicated_rates));

preferences:
29.89 ms | 405 KiB | 5 Q