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($new, $saved, 'cmpr')); function cmpr($a, $b) { foreach($a as $k=>$v) { if ($b[$k] !== $v) return -1; } return 0; }
based on b7PZc
Output for 7.0.0 - 7.1.0
array(3) { [0]=> array(3) { ["domain"]=> string(12) "mydomain.com" ["record"]=> string(1) "A" ["value"]=> string(7) "4.4.4.4" } [1]=> array(3) { ["domain"]=> string(12) "mydomain.com" ["record"]=> string(2) "NS" ["value"]=> string(16) "ns1.mydomain.com" } [2]=> array(3) { ["domain"]=> string(16) "sub.mydomain.com" ["record"]=> string(1) "A" ["value"]=> string(7) "1.2.3.4" } }
Output for 5.0.0 - 5.6.21
array(2) { [0]=> array(3) { ["domain"]=> string(12) "mydomain.com" ["record"]=> string(1) "A" ["value"]=> string(7) "4.4.4.4" } [2]=> array(3) { ["domain"]=> string(16) "sub.mydomain.com" ["record"]=> string(1) "A" ["value"]=> string(7) "1.2.3.4" } }
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: array_udiff() in /in/6odmb 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/6odmb 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/6odmb on line 14