3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $sum = "267.60"; $needSms = "true"; var_dump(sprintf("%015.2f", floatval($sum) + ($needSms == "true" ? 0.5 : 0.0))); $needSms = "false"; var_dump(sprintf("%015.2f", floatval($sum) + ($needSms == "true" ? 0.5 : 0.0)));
Output for 4.3.7 - 7.1.0
string(15) "000000000268.10" string(15) "000000000267.60"
Output for 4.3.0 - 4.3.6
string(18) "000000000000268.10" string(18) "000000000000267.60"