3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $var =-9223372036854775808.99; var_dump($var); var_dump(sprintf('%0.20f', $var)); $var =-9223372036854999999; var_dump($var); var_dump(sprintf('%0.20f', $var)); $var = 9223372036854775807.0001; var_dump(sprintf('%0.20f', $var));
Output for 5.2.1 - 7.1.0
float(-9.2233720368548E+18) string(41) "-9223372036854775808.00000000000000000000" float(-9.223372036855E+18) string(41) "-9223372036854999040.00000000000000000000" string(40) "9223372036854775808.00000000000000000000"
Output for 4.3.0 - 4.3.1, 4.3.3 - 5.2.0
float(-9.2233720368548E+18) string(41) "-9223372036854776000.00000000000000000000" float(-9.223372036855E+18) string(41) "-9223372036854997000.00000000000000000000" string(40) "9223372036854776000.00000000000000000000"
Output for 4.3.2
float(-9.2233720368548E+18) string(42) "-9223372036854776000.00000000000000000000" float(-9.223372036855E+18) string(42) "-9223372036854997000.00000000000000000000" string(40) "9223372036854776000.00000000000000000000"