3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $arr1 = array("wi_fi" => 0, "test" => "abcd"); $arr2 = array([wi_fi] => 1, "test" => "abc"); var_dump(array_diff($arr1,$arr2));
based on pJEVe
Output for 7.2.0
Warning: Use of undefined constant wi_fi - assumed 'wi_fi' (this will throw an Error in a future version of PHP) in /in/i2tBL on line 5 Warning: Illegal offset type in /in/i2tBL on line 5 array(2) { ["wi_fi"]=> int(0) ["test"]=> string(4) "abcd" }
Output for 5.4.11 - 7.1.10
Notice: Use of undefined constant wi_fi - assumed 'wi_fi' in /in/i2tBL on line 5 Warning: Illegal offset type in /in/i2tBL on line 5 array(2) { ["wi_fi"]=> int(0) ["test"]=> string(4) "abcd" }
Output for 5.3.21 - 5.3.29
Parse error: syntax error, unexpected '[', expecting ')' in /in/i2tBL on line 5
Process exited with code 255.