3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function bucketize($num, $size){ $overage = $num % $size; $base = $num - $overage; return $base . '+'; } for ($i=9; $i < 26; $i++){ var_dump(bucketize($i, 5)); }
Output for 5.6.0 - 5.6.30, hhvm-3.18.5 - 3.22.0, 7.1.0 - 7.3.1
string(2) "5+" string(3) "10+" string(3) "10+" string(3) "10+" string(3) "10+" string(3) "10+" string(3) "15+" string(3) "15+" string(3) "15+" string(3) "15+" string(3) "15+" string(3) "20+" string(3) "20+" string(3) "20+" string(3) "20+" string(3) "20+" string(3) "25+"