3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $ar_val= array ("0" => "134567", "1" => "dogs", "2" => "food", "3" => "EEUU"); $ar_url= array ("0" => "134567", "1" => "food", "2" => "dogs", "3" => "EEUU"); $result = array_diff($ar_val, $ar_url); $num = 0; if ($result != NULL) { echo "unique array keys: TRUE" . "\n\n"; print_r($result); echo "\n\n"; } else { echo "unique array keys: FALSE" . "\n\n"; } foreach($ar_val as $key) { if ($ar_val[$num] != $ar_url[$num]) { echo "intersecting array key different: TRUE" . "\n> "; print_r($ar_val[$num]); echo "\n\n"; } $num++; } ?>
Output for 4.3.0 - 7.1.0
unique array keys: FALSE intersecting array key different: TRUE > dogs intersecting array key different: TRUE > food