3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array =[ 0 => [ 0 => "AUA3H147", 1 => 2015, 2 => 'Audi' ], 1 => [ 0 => "AUA3H147", 1 => 2015, 2 => 'Ford' ], 2 => [ 0 => "AUA3H148", 1 => 2016, 2 => 'Chevy' ], 3 => [ 0 => "AUA3H148", 1 => 2017, 2 => 'Buick' ] ]; foreach ($array as $a) { $compositeKey = $a[0] . '_' . $a[1]; $result[$compositeKey] ??= $a; // only store if first occurrence of compositeKey } var_export(array_values($result)); // re-index and print
Output for git.master, git.master_jit, rfc.property-hooks
array ( 0 => array ( 0 => 'AUA3H147', 1 => 2015, 2 => 'Audi', ), 1 => array ( 0 => 'AUA3H148', 1 => 2016, 2 => 'Chevy', ), 2 => array ( 0 => 'AUA3H148', 1 => 2017, 2 => 'Buick', ), )

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:
124.52 ms | 406 KiB | 5 Q