3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php define("EOL", "\n"); $m = 3; for($i = 0; $i <= $m; $i++){ $k = $i ? floor(log($i, $m)) : 0; $l = 0; for($o = $k; $o >= 0; $o--){ $l += pow($m, $k); } echo $l, EOL; }
based on mXjJD
Output for 5.3.20 - 7.2.0
1 1 1 6