3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = [ 'foo' => null, ]; $b = [ 'foo' => 'str', ]; $c = [ 'foo' => [1, 3], ]; echo "1:\n"; var_dump(array_intersect($a, $b)); echo "\n2:\n"; var_dump(array_intersect($b, $c));
Output for 8.0.1 - 8.0.30, 8.1.0 - 8.1.30, 8.2.0 - 8.2.25, 8.3.0 - 8.3.14
1: array(0) { } 2: Warning: Array to string conversion in /in/TYrqn on line 16 array(0) { }

preferences:
42.04 ms | 406 KiB | 5 Q