3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $keys = [1,2]; $items = []; foreach ($keys as $i => $key) { $item = null; if (!empty($item)) { $items[$i] = $item; } else { $items[$i] = null; } } $result = array(); if(!empty($items)){ print_r($items); }
Output for 5.5.0 - 7.3.0rc4
Array ( [0] => [1] => )