3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a= [['a', 10], ['b', 11], ['c', 12], ['d', 13]]; $b = [['k', 21], ['l', 22], ['m', 23]]; $diff = array_udiff($a, $b, function($o1, $o2) { echo 'comparing ' . var_export($o1, true) . ', ' . var_export($o2, true); return $o1[1] - $o2[1]; }); var_dump($diff);
Output for git.master, git.master_jit, rfc.property-hooks
comparing array ( 0 => 'a', 1 => 10, ), array ( 0 => 'b', 1 => 11, )comparing array ( 0 => 'b', 1 => 11, ), array ( 0 => 'c', 1 => 12, )comparing array ( 0 => 'c', 1 => 12, ), array ( 0 => 'd', 1 => 13, )comparing array ( 0 => 'k', 1 => 21, ), array ( 0 => 'l', 1 => 22, )comparing array ( 0 => 'l', 1 => 22, ), array ( 0 => 'm', 1 => 23, )comparing array ( 0 => 'a', 1 => 10, ), array ( 0 => 'k', 1 => 21, )comparing array ( 0 => 'a', 1 => 10, ), array ( 0 => 'b', 1 => 11, )comparing array ( 0 => 'b', 1 => 11, ), array ( 0 => 'k', 1 => 21, )comparing array ( 0 => 'b', 1 => 11, ), array ( 0 => 'c', 1 => 12, )comparing array ( 0 => 'c', 1 => 12, ), array ( 0 => 'k', 1 => 21, )comparing array ( 0 => 'c', 1 => 12, ), array ( 0 => 'd', 1 => 13, )comparing array ( 0 => 'd', 1 => 13, ), array ( 0 => 'k', 1 => 21, )array(4) { [0]=> array(2) { [0]=> string(1) "a" [1]=> int(10) } [1]=> array(2) { [0]=> string(1) "b" [1]=> int(11) } [2]=> array(2) { [0]=> string(1) "c" [1]=> int(12) } [3]=> array(2) { [0]=> string(1) "d" [1]=> int(13) } }

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:
34.32 ms | 403 KiB | 8 Q