3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr1 = [ [ "id" => '1', "order" => '123238' ], [ "id" => '2', "order" => '33278' ], [ "id" => '3', "order" => '8892372' ] ]; $arr2 = [ [ "id" => '1', "order" => '349483' ], [ "id" => '2', "order" => '9837283' ], [ "id" => '3', "order" => '33278' ] ]; $intersect = array_uintersect($arr1, $arr2, function ($a, $b) { return strcmp($a['order'], $b['order']); }); print_r($intersect); $notInArr1 = array_uintersect($arr1, $arr2, function ($a, $b) { if ($a["order"] === $b["order"]) return -1; if ($a["order"] > $b["order"]) return 1; return 0; }); print_r($notInArr1); $notInArr2 = array_uintersect($arr2, $arr1, function ($a, $b) { if ($a["order"] === $b["order"]) return -1; if ($a["order"] > $b["order"]) return 1; return 0; }); print_r($notInArr2);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [1] => Array ( [id] => 2 [order] => 33278 ) ) Array ( [0] => Array ( [id] => 1 [order] => 123238 ) [2] => Array ( [id] => 3 [order] => 8892372 ) ) Array ( [0] => Array ( [id] => 1 [order] => 349483 ) [1] => Array ( [id] => 2 [order] => 9837283 ) )

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