3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $saved = array( array( 'domain' => 'mydomain.com', 'record' => 'A', 'value' => '8.8.8.8' ), array( 'domain' => 'mydomain.com', 'record' => 'NS', 'value' => 'ns1.mydomain.com' ) ); $new = array( array( 'domain' => 'mydomain.com', 'record' => 'A', 'value' => '4.4.4.4' ), array( 'domain' => 'mydomain.com', 'record' => 'NS', 'value' => 'ns1.mydomain.com' ), array( 'domain' => 'sub.mydomain.com', 'record' => 'A', 'value' => '1.2.3.4' ), ); var_dump(array_udiff($saved, $new, 'cmpr')); function cmpr($a, $b) { foreach($a as $k=>$v) { if ($b[$k] !== $v) return 1; } return 0; }
based on hSWvK
Output for 5.2.6 - 5.2.14, 5.3.0 - 5.3.3, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
array(1) { [0]=> array(3) { ["domain"]=> string(12) "mydomain.com" ["record"]=> string(1) "A" ["value"]=> string(7) "8.8.8.8" } }
Output for 5.0.0 - 5.2.5, 5.2.15 - 5.2.17, 5.3.4 - 5.6.28
array(2) { [0]=> array(3) { ["domain"]=> string(12) "mydomain.com" ["record"]=> string(1) "A" ["value"]=> string(7) "8.8.8.8" } [1]=> array(3) { ["domain"]=> string(12) "mydomain.com" ["record"]=> string(2) "NS" ["value"]=> string(16) "ns1.mydomain.com" } }
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: array_udiff() in /in/eYoov on line 14
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: array_udiff() in /in/eYoov on line 14
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: array_udiff() in /in/eYoov on line 14