3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $a = [1, 2, 3]; $b = array_map(function ($_) { if ($_ === 1) return 4; }, $a); var_dump($b); var_dump(array_values($b));
Output for 5.6.0 - 5.6.30, hhvm-3.15.4, 7.0.0 - 7.2.0
array(3) { [0]=> int(4) [1]=> NULL [2]=> NULL } array(3) { [0]=> int(4) [1]=> NULL [2]=> NULL }