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' ), ); $combined = array_merge($saved, $new); var_dump(array_udiff_assoc($saved, $new, 'cmpr')); function cmpr($a, $b) { foreach($a as $k=>$v) { if ($b[$k] !== $v) return 1; } return 0; }
based on NSoUM
Output for 5.0.0 - 5.6.28, 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 4.4.5 - 4.4.9
Fatal error: Call to undefined function: array_udiff_assoc() in /in/N3uPP on line 16
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: array_udiff_assoc() in /in/N3uPP on line 16
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: array_udiff_assoc() in /in/N3uPP on line 16