3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php for ($p = 14; $p < 30; $p++) { ini_set('precision', $p); echo "precision $p\n"; for($x = 1; $x < 11; $x++) { echo $x / 10; echo "\n"; } }
Output for 4.3.0 - 5.6.28, 7.0.0 - 7.1.0
precision 14 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 precision 15 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 precision 16 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 precision 17 0.10000000000000001 0.20000000000000001 0.29999999999999999 0.40000000000000002 0.5 0.59999999999999998 0.69999999999999996 0.80000000000000004 0.90000000000000002 1 precision 18 0.100000000000000006 0.200000000000000011 0.299999999999999989 0.400000000000000022 0.5 0.599999999999999978 0.699999999999999956 0.800000000000000044 0.900000000000000022 1 precision 19 0.1000000000000000056 0.2000000000000000111 0.2999999999999999889 0.4000000000000000222 0.5 0.5999999999999999778 0.6999999999999999556 0.8000000000000000444 0.9000000000000000222 1 precision 20 0.10000000000000000555 0.2000000000000000111 0.2999999999999999889 0.4000000000000000222 0.5 0.5999999999999999778 0.69999999999999995559 0.80000000000000004441 0.9000000000000000222 1 precision 21 0.100000000000000005551 0.200000000000000011102 0.299999999999999988898 0.400000000000000022204 0.5 0.599999999999999977796 0.699999999999999955591 0.800000000000000044409 0.900000000000000022204 1 precision 22 0.1000000000000000055511 0.2000000000000000111022 0.2999999999999999888978 0.4000000000000000222045 0.5 0.5999999999999999777955 0.6999999999999999555911 0.8000000000000000444089 0.9000000000000000222045 1 precision 23 0.10000000000000000555112 0.20000000000000001110223 0.29999999999999998889777 0.40000000000000002220446 0.5 0.59999999999999997779554 0.69999999999999995559108 0.80000000000000004440892 0.90000000000000002220446 1 precision 24 0.100000000000000005551115 0.20000000000000001110223 0.29999999999999998889777 0.40000000000000002220446 0.5 0.59999999999999997779554 0.699999999999999955591079 0.800000000000000044408921 0.90000000000000002220446 1 precision 25 0.1000000000000000055511151 0.2000000000000000111022302 0.2999999999999999888977698 0.4000000000000000222044605 0.5 0.5999999999999999777955395 0.699999999999999955591079 0.800000000000000044408921 0.9000000000000000222044605 1 precision 26 0.10000000000000000555111512 0.20000000000000001110223025 0.29999999999999998889776975 0.40000000000000002220446049 0.5 0.59999999999999997779553951 0.69999999999999995559107901 0.80000000000000004440892099 0.90000000000000002220446049 1 precision 27 0.100000000000000005551115123 0.200000000000000011102230246 0.299999999999999988897769754 0.400000000000000022204460493 0.5 0.599999999999999977795539507 0.699999999999999955591079015 0.800000000000000044408920985 0.900000000000000022204460493 1 precision 28 0.1000000000000000055511151231 0.2000000000000000111022302463 0.2999999999999999888977697537 0.4000000000000000222044604925 0.5 0.5999999999999999777955395075 0.699999999999999955591079015 0.800000000000000044408920985 0.9000000000000000222044604925 1 precision 29 0.10000000000000000555111512313 0.20000000000000001110223024625 0.29999999999999998889776975375 0.4000000000000000222044604925 0.5 0.5999999999999999777955395075 0.69999999999999995559107901499 0.80000000000000004440892098501 0.9000000000000000222044604925 1
Output for hhvm-3.10.0 - 3.12.0
precision 14 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 precision 15 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 precision 16 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 precision 17 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 precision 18 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 precision 19 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 precision 20 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 precision 21 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 precision 22 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 precision 23 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 precision 24 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 precision 25 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 precision 26 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 precision 27 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 precision 28 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 precision 29 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1