3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $d = 0.30; do { $d = bcsub($d, 0.01, 4); var_dump($d); } while ($d >= 0.00);
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
string(6) "0.2900" string(6) "0.2800" string(6) "0.2700" string(6) "0.2600" string(6) "0.2500" string(6) "0.2400" string(6) "0.2300" string(6) "0.2200" string(6) "0.2100" string(6) "0.2000" string(6) "0.1900" string(6) "0.1800" string(6) "0.1700" string(6) "0.1600" string(6) "0.1500" string(6) "0.1400" string(6) "0.1300" string(6) "0.1200" string(6) "0.1100" string(6) "0.1000" string(6) "0.0900" string(6) "0.0800" string(6) "0.0700" string(6) "0.0600" string(6) "0.0500" string(6) "0.0400" string(6) "0.0300" string(6) "0.0200" string(6) "0.0100" string(6) "0.0000" string(7) "-0.0100"