3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $array = [0,0,0,0,0,0,500 ,11000,100,110,221,1245,2141,0,0,0,0,0]; $result = array_filter($array); echo 'fisrt: '.key($result); end($result); echo "</br>"; echo 'last: '.key($result);
based on sLq23
Output for 5.6.0 - 5.6.30, hhvm-3.18.5 - 3.22.0, 7.0.0 - 7.3.0beta1
fisrt: 6</br>last: 12