3v4l.org

run code in 300+ PHP versions simultaneously
<?php $articles = [ [ "id" => 0, "title" => "lorem", "reference" => "A" ], [ "id" => 1, "title" => "ipsum", "reference" => "B" ], [ "id" => 2, "title" => "dolor", "reference" => "C" ], [ "id" => 3, "title" => "sit", "reference" => "A" ] ]; $found = []; foreach ($articles as $index => ['reference' => $ref]) { if (!isset($found[$ref])) { $found[$ref] = $index; } else { unset($articles[$index], $articles[$found[$ref]]); } } var_export($articles);
Output for git.master, git.master_jit, rfc.property-hooks
array ( 1 => array ( 'id' => 1, 'title' => 'ipsum', 'reference' => 'B', ), 2 => array ( 'id' => 2, 'title' => 'dolor', 'reference' => 'C', ), )

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:
58.62 ms | 401 KiB | 8 Q