3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $number = '2.05'; echo '1:'; var_dump($number); $number1 = round($number * 100); $number2 = $number * 100; echo "\n2.1: "; var_export($number1) ; echo "\n2.2: "; var_export($number2); echo "\n2.compare: "; var_export($number1 == $number2); echo "\n3: "; $ret1 = intval( $number1); $ret2 = intval( $number2); var_dump($ret1); var_dump($ret2); ?>
based on qLWoQ
Output for 7.0.14 - 7.1.0
1:string(4) "2.05" 2.1: 205.0 2.2: 204.99999999999997 2.compare: false 3: int(205) int(204)
Output for 7.0.2 - 7.0.10
1:string(4) "2.05" 2.1: 205.0 2.2: 204.999999999999971578291 2.compare: false 3: int(205) int(204)
Output for 5.4.22 - 5.4.45, 5.5.6 - 5.6.25, 7.0.0 - 7.0.1
1:string(4) "2.05" 2.1: 205 2.2: 204.999999999999971578291 2.compare: false 3: int(205) int(204)
Output for 4.3.0 - 5.4.21, 5.5.0 - 5.5.5, hhvm-3.10.0 - 3.12.0
1:string(4) "2.05" 2.1: 205 2.2: 205 2.compare: false 3: int(205) int(204)
Output for 5.6.28
1:string(4) "2.05" 2.1: 205 2.2: 204.99999999999997 2.compare: false 3: int(205) int(204)