3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ [ 'id[0]' => 'BX-78', 'Name[0]' => 'XXX', 'Address[0]' => 'YUUSATD' ], [ 'id[1]' => 'BX-79', 'Name[1]' => 'YYY', 'Address[1]' => 'DHJSHDJGY' ], [ 'id[2]' => 'BX-80', 'Name[2]' => 'ZZZ', 'Address[2]' => 'DDSDSDA' ], [ 'id[3]' => 'BX-78', 'Name[3]' => 'AAA', 'Address[3]' => 'FSDSDS' ], [ 'id[4]' => 'BX-81', 'Name[4]' => 'XXX', 'Address[4]' => 'DSDSDSD' ] ]; foreach ($array as $index => $a) { foreach ($array as $v) { if ($v === $a) continue; if (reset($v) === reset($a)) $array[$index]["id"] = "duplicate"; if (next($v) === next($a)) $array[$index]["name"] = "duplicate"; } } $array = array_reduce($array, function($carry, $item) { if (array_key_exists("id", $item) || array_key_exists("name", $item)) { unset($item["id"], $item["name"]); $carry[] = $item; } return $carry; }, []); print_r($array);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => Array ( [id[0]] => BX-78 [Name[0]] => XXX [Address[0]] => YUUSATD ) [1] => Array ( [id[3]] => BX-78 [Name[3]] => AAA [Address[3]] => FSDSDS ) [2] => Array ( [id[4]] => BX-81 [Name[4]] => XXX [Address[4]] => DSDSDSD ) )

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