3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $x = ['1', '2']; $y = ['2', '1']; $z = ['1', '2', '4']; $n = [1, 2]; function array_equal($a, $b) { return ( is_array($a) && is_array($b) && count($a) == count($b) && array_diff($a, $b) === array_diff($b, $a) ); } echo array_equal($x, $y) ? 'y1' : 'n1'; echo array_equal($x, $z) ? 'y2' : 'n2'; echo array_equal($x, $n) ? 'y3' : 'n3';
Output for hhvm-3.10.1
y1n2y3