3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $foo = array('white ', 'black'); $foo = array_map( function ($n) { return trim($n); } ); $bar = array('white', 'red'); $baz = array_intersect($foo, $bar); var_dump($baz);
based on jL6IO
Output for 7.0.0 - 7.2.0
Warning: array_map() expects at least 2 parameters, 1 given in /in/pWZUK on line 7 Warning: array_intersect(): Argument #1 is not an array in /in/pWZUK on line 12 NULL
Output for 5.3.19 - 5.6.28
Warning: array_map() expects at least 2 parameters, 1 given in /in/pWZUK on line 8 Warning: array_intersect(): Argument #1 is not an array in /in/pWZUK on line 12 NULL