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(50);
based on eoF2P
Output for 5.3.18 - 5.5.28, 5.5.31 - 5.5.33, 5.5.35 - 5.6.12, 5.6.16 - 5.6.19, 5.6.21 - 7.0.4, 7.0.6 - 7.2.0
49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 30414093201713378043612608166064768844377641568960512000000000000
Output for 7.0.5
49 Fatal error: Uncaught Error: Call to undefined function bcmul() in /in/LsAWG:7 Stack trace: #0 /in/LsAWG(16): bcfact(49) #1 {main} thrown in /in/LsAWG on line 7
Process exited with code 255.
Output for 5.5.29 - 5.5.30, 5.5.34, 5.6.13 - 5.6.15, 5.6.20
49 Fatal error: Call to undefined function bcmul() in /in/LsAWG on line 7
Process exited with code 255.