3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = [['A', 'B'],['C', 'B'],['B', 'C'],['A', 'A'],['B', 'A'],['B', 'B'],]; $temp = []; // temporary container $new_arr = array_filter($arr, function($e) use(&$temp) { $orig = $e; // create an original copy sort($e); // sort if(!in_array($e, $temp)) { $temp[] = $e; // push if doesn't exist yet return $orig; // return the orig } }); print_r($new_arr);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => Array ( [0] => A [1] => B ) [1] => Array ( [0] => C [1] => B ) [3] => Array ( [0] => A [1] => A ) [5] => Array ( [0] => B [1] => B ) )

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