3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $a = [ 'foo' => [1], 'bar' => 5, ]; $b = [ 'foo' => [1], 'bar' => 6, ]; $i = array_diff($a, $b); $j = array_diff($b, $a); var_dump($i, $j);
based on ugEEE
Output for 7.0.0 - 7.2.0
Notice: Array to string conversion in /in/cta83 on line 12 Notice: Array to string conversion in /in/cta83 on line 12 Notice: Array to string conversion in /in/cta83 on line 13 Notice: Array to string conversion in /in/cta83 on line 13 array(1) { ["bar"]=> int(5) } array(1) { ["bar"]=> int(6) }
Output for 5.4.11 - 5.6.28
Notice: Array to string conversion in /in/cta83 on line 12 Notice: Array to string conversion in /in/cta83 on line 12 Notice: Array to string conversion in /in/cta83 on line 12 Notice: Array to string conversion in /in/cta83 on line 12 Notice: Array to string conversion in /in/cta83 on line 12 Notice: Array to string conversion in /in/cta83 on line 12 Notice: Array to string conversion in /in/cta83 on line 13 Notice: Array to string conversion in /in/cta83 on line 13 Notice: Array to string conversion in /in/cta83 on line 13 Notice: Array to string conversion in /in/cta83 on line 13 Notice: Array to string conversion in /in/cta83 on line 13 Notice: Array to string conversion in /in/cta83 on line 13 array(1) { ["bar"]=> int(5) } array(1) { ["bar"]=> int(6) }
Output for 5.3.21 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/cta83 on line 3
Process exited with code 255.