3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $entries = array( "111 222 465", "666 123 412", "000 999", ); $test = array(111, 465, 555, 666, 777); foreach ($entries as $key => $etry) { $plotsTotal1 = explode(' ', $entry); $plotsTotal2 = array_filter($plotsTotal1); $matches = array_intersect($test, $plotsTotal2); if (count($matches) > 0) { echo 'Entry ' . $key. ' contains ' . implode(',', $matches) . '<br/>'; } }
Output for 5.0.4 - 7.1.0
Notice: Undefined variable: entry in /in/mAQTt on line 11 Notice: Undefined variable: entry in /in/mAQTt on line 11 Notice: Undefined variable: entry in /in/mAQTt on line 11
Output for 4.3.0 - 5.0.3
Notice: Undefined variable: entry in /in/mAQTt on line 11 Notice: Undefined variable: entry in /in/mAQTt on line 11 Notice: Undefined variable: entry in /in/mAQTt on line 11