3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo var_export(20 / 3 * 1e6, true) . "\n"; echo var_export(6.66, true) . "\n"; echo var_export(6.0, true) . "\n"; function format($f) { return rtrim(rtrim(number_format($f, ini_get('precision'), '.', ''), '0'), '.'); } echo format(20/3) . "\n"; echo format((20/3) * 1e6) . "\n"; echo format(6.66) . "\n"; echo format(6.0) . "\n"; echo format(60.0) . "\n";
Output for 7.1.0 - 7.1.20, 7.2.0 - 7.2.33, 7.3.12 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.27, 8.2.0 - 8.2.17, 8.3.0 - 8.3.4
6666666.666666667 6.66 6.0 6.66666666666667 6666666.66666666697711 6.66 6 60
Output for 7.0.14 - 7.0.20
6666666.666666667 6.6600000000000001 6.0 6.66666666666667 6666666.66666666697711 6.66 6 60
Output for 7.0.2 - 7.0.10
6666666.66666666697710752 6.66000000000000014210855 6.0 6.66666666666667 6666666.66666666697711 6.66 6 60
Output for 5.4.22 - 5.4.45, 5.5.6 - 5.5.38, 5.6.0 - 5.6.25, 7.0.0 - 7.0.1
6666666.66666666697710752 6.66000000000000014210855 6 6.66666666666667 6666666.66666666697711 6.66 6 60
Output for 5.6.28
6666666.666666667 6.6600000000000001 6 6.66666666666667 6666666.66666666697711 6.66 6 60
Output for 4.3.0 - 4.3.4, 5.3.0 - 5.3.29, 5.4.0 - 5.4.21, 5.5.0 - 5.5.5
6666666.6666667 6.66 6 6.66666666666667 6666666.66666666697711 6.66 6 60
Output for 4.3.5 - 4.3.11, 4.4.0 - 4.4.9, 5.0.0 - 5.0.5, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17
6666666.6666667 6.66 6 6.66666666666667 6666666.66666666790843 6.66 6 60

preferences:
231.06 ms | 402 KiB | 352 Q