3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $a = [ 'foo', 'bar', 'zoo' => [] ]; $b = [ 'foo', 'bar', 'zoo' => [] ]; var_dump($a); var_dump($b); var_dump(array_diff($a, $b));
based on TBYtc
Output for hhvm-3.18.5 - 3.21.3, 7.0.28 - 7.3.1
array(3) { [0]=> string(3) "foo" [1]=> string(3) "bar" ["zoo"]=> array(0) { } } array(3) { [0]=> string(3) "foo" [1]=> string(3) "bar" ["zoo"]=> array(0) { } } Notice: Array to string conversion in /in/RfDYs on line 19 Notice: Array to string conversion in /in/RfDYs on line 19 array(0) { }
Output for hhvm-3.22.0
array(3) { [0]=> string(3) "foo" [1]=> string(3) "bar" ["zoo"]=> array(0) { } } array(3) { [0]=> string(3) "foo" [1]=> string(3) "bar" ["zoo"]=> array(0) { } } Notice: Array to string conversion in /in/RfDYs on line -1 Notice: Array to string conversion in /in/RfDYs on line -1 array(0) { }
Output for 5.6.30
array(3) { [0]=> string(3) "foo" [1]=> string(3) "bar" ["zoo"]=> array(0) { } } array(3) { [0]=> string(3) "foo" [1]=> string(3) "bar" ["zoo"]=> array(0) { } } Notice: Array to string conversion in /in/RfDYs on line 19 Notice: Array to string conversion in /in/RfDYs on line 19 Notice: Array to string conversion in /in/RfDYs on line 19 Notice: Array to string conversion in /in/RfDYs on line 19 Notice: Array to string conversion in /in/RfDYs on line 19 array(0) { }