3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $a = ['a' => 1, 'b' => 2]; $b = [['a' => 1, 'b' => 3], ['a' => 1, 'b' => 4], ['a' => 1, 'b' => 5]]; $c = array_diff($a, $b); var_dump($c);
based on 6QW9N
Output for 7.0.0 - 7.2.0
Notice: Array to string conversion in /in/eRTg3 on line 7 Notice: Array to string conversion in /in/eRTg3 on line 7 Notice: Array to string conversion in /in/eRTg3 on line 7 array(2) { ["a"]=> int(1) ["b"]=> int(2) }
Output for 5.4.10 - 5.6.21
Notice: Array to string conversion in /in/eRTg3 on line 7 Notice: Array to string conversion in /in/eRTg3 on line 7 Notice: Array to string conversion in /in/eRTg3 on line 7 Notice: Array to string conversion in /in/eRTg3 on line 7 Notice: Array to string conversion in /in/eRTg3 on line 7 Notice: Array to string conversion in /in/eRTg3 on line 7 array(2) { ["a"]=> int(1) ["b"]=> int(2) }
Output for 5.3.20 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/eRTg3 on line 3
Process exited with code 255.