3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $A = [3,45,67,8]; $B = [ 1 => [1,6,8], 2 => [5,67,3,4,5,66,6], 3 => [55,56,57,58], 4 => [45,80,81,82] ]; $result = []; foreach ($B as $key => $haystack) { if (array_intersect($B, $A)) { $result[] = $key; } } var_export($result);
based on 3eGof
Output for 7.0.28 - 7.3.0rc3
Notice: Array to string conversion in /in/5rRNf on line 11 Notice: Array to string conversion in /in/5rRNf on line 11 Notice: Array to string conversion in /in/5rRNf on line 11 Notice: Array to string conversion in /in/5rRNf on line 11 Notice: Array to string conversion in /in/5rRNf on line 11 Notice: Array to string conversion in /in/5rRNf on line 11 Notice: Array to string conversion in /in/5rRNf on line 11 Notice: Array to string conversion in /in/5rRNf on line 11 Notice: Array to string conversion in /in/5rRNf on line 11 Notice: Array to string conversion in /in/5rRNf on line 11 Notice: Array to string conversion in /in/5rRNf on line 11 Notice: Array to string conversion in /in/5rRNf on line 11 Notice: Array to string conversion in /in/5rRNf on line 11 Notice: Array to string conversion in /in/5rRNf on line 11 Notice: Array to string conversion in /in/5rRNf on line 11 Notice: Array to string conversion in /in/5rRNf on line 11 Notice: Array to string conversion in /in/5rRNf on line 11 Notice: Array to string conversion in /in/5rRNf on line 11 Notice: Array to string conversion in /in/5rRNf on line 11 Notice: Array to string conversion in /in/5rRNf on line 11 Notice: Array to string conversion in /in/5rRNf on line 11 Notice: Array to string conversion in /in/5rRNf on line 11 Notice: Array to string conversion in /in/5rRNf on line 11 Notice: Array to string conversion in /in/5rRNf on line 11 Notice: Array to string conversion in /in/5rRNf on line 11 Notice: Array to string conversion in /in/5rRNf on line 11 Notice: Array to string conversion in /in/5rRNf on line 11 Notice: Array to string conversion in /in/5rRNf on line 11 Notice: Array to string conversion in /in/5rRNf on line 11 Notice: Array to string conversion in /in/5rRNf on line 11 Notice: Array to string conversion in /in/5rRNf on line 11 Notice: Array to string conversion in /in/5rRNf on line 11 Notice: Array to string conversion in /in/5rRNf on line 11 Notice: Array to string conversion in /in/5rRNf on line 11 Notice: Array to string conversion in /in/5rRNf on line 11 Notice: Array to string conversion in /in/5rRNf on line 11 Notice: Array to string conversion in /in/5rRNf on line 11 Notice: Array to string conversion in /in/5rRNf on line 11 Notice: Array to string conversion in /in/5rRNf on line 11 Notice: Array to string conversion in /in/5rRNf on line 11 array ( )
Output for 5.6.38
Notice: Array to string conversion in /in/5rRNf on line 11 Notice: Array to string conversion in /in/5rRNf on line 11 Notice: Array to string conversion in /in/5rRNf on line 11 Notice: Array to string conversion in /in/5rRNf on line 11 Notice: Array to string conversion in /in/5rRNf on line 11 Notice: Array to string conversion in /in/5rRNf on line 11 Notice: Array to string conversion in /in/5rRNf on line 11 Notice: Array to string conversion in /in/5rRNf on line 11 Notice: Array to string conversion in /in/5rRNf on line 11 Notice: Array to string conversion in /in/5rRNf on line 11 Notice: Array to string conversion in /in/5rRNf on line 11 Notice: Array to string conversion in /in/5rRNf on line 11 Notice: Array to string conversion in /in/5rRNf on line 11 Notice: Array to string conversion in /in/5rRNf on line 11 Notice: Array to string conversion in /in/5rRNf on line 11 Notice: Array to string conversion in /in/5rRNf on line 11 Notice: Array to string conversion in /in/5rRNf on line 11 Notice: Array to string conversion in /in/5rRNf on line 11 Notice: Array to string conversion in /in/5rRNf on line 11 Notice: Array to string conversion in /in/5rRNf on line 11 Notice: Array to string conversion in /in/5rRNf on line 11 Notice: Array to string conversion in /in/5rRNf on line 11 Notice: Array to string conversion in /in/5rRNf on line 11 Notice: Array to string conversion in /in/5rRNf on line 11 Notice: Array to string conversion in /in/5rRNf on line 11 Notice: Array to string conversion in /in/5rRNf on line 11 Notice: Array to string conversion in /in/5rRNf on line 11 Notice: Array to string conversion in /in/5rRNf on line 11 Notice: Array to string conversion in /in/5rRNf on line 11 Notice: Array to string conversion in /in/5rRNf on line 11 Notice: Array to string conversion in /in/5rRNf on line 11 Notice: Array to string conversion in /in/5rRNf on line 11 Notice: Array to string conversion in /in/5rRNf on line 11 Notice: Array to string conversion in /in/5rRNf on line 11 Notice: Array to string conversion in /in/5rRNf on line 11 Notice: Array to string conversion in /in/5rRNf on line 11 Notice: Array to string conversion in /in/5rRNf on line 11 Notice: Array to string conversion in /in/5rRNf on line 11 Notice: Array to string conversion in /in/5rRNf on line 11 Notice: Array to string conversion in /in/5rRNf on line 11 Notice: Array to string conversion in /in/5rRNf on line 11 Notice: Array to string conversion in /in/5rRNf on line 11 Notice: Array to string conversion in /in/5rRNf on line 11 Notice: Array to string conversion in /in/5rRNf on line 11 Notice: Array to string conversion in /in/5rRNf on line 11 Notice: Array to string conversion in /in/5rRNf on line 11 Notice: Array to string conversion in /in/5rRNf on line 11 Notice: Array to string conversion in /in/5rRNf on line 11 array ( )