3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function bcfact($n){ $factorial=$n; while (--$n>1) { echo $n. PHP_EOL; $factorial=bcmul($factorial,$n); } return $factorial; } echo PHP_EOL; echo PHP_EOL; echo PHP_EOL; print bcfact(5);
based on LsAWG
Output for 5.4.0 - 7.2.0
4 3 2 120