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' ] ]; // values in both $arr1 and $arr2 print_r(array_uintersect($arr1, $arr2, function ($a, $b) { return $a['order'] - $b['order']; })); // values in $arr1 but not $arr2 print_r(array_udiff($arr1, $arr2, function ($a, $b) { return $a['order'] - $b['order']; })); // values in $arr2 but not $arr1 print_r(array_udiff($arr1, $arr2, function ($a, $b) { return $a['order'] - $b['order']; })); ?>
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] => 123238 ) [2] => Array ( [id] => 3 [order] => 8892372 ) )

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