3v4l.org

run code in 300+ PHP versions simultaneously
<?php $b = [1 => 1, 1 => 1]; $a = [4 => 1, 2=> 2]; if (count(array_diff(array_merge($a, $b), array_intersect($a, $b))) === 0) { echo 'the same'; } else { echo 'not the same'; }

preferences:
33.47 ms | 402 KiB | 5 Q