3v4l.org

run code in 300+ PHP versions simultaneously
<?php var_dump(4.22/0.01 == (int)(4.22/0.01)); // false var_dump([ '4.22*(1/0.01)' => 4.22*(1/0.01), '4.22/0.01' => 4.22/0.01, '(int)(4.22/0.01)' => (int)(4.22/0.01), '(int)(string)(4.22/0.01)' => (int)(string)(4.22/0.01) ]); var_dump(4.22*(1/0.01) == (int)(4.22*(1/0.01))); // true var_dump((string)(4.22/0.01) == (int)(string)(4.22/0.01)); // true var_dump(round(4.22/0.01, 4) == (int)round(4.22/0.01, 4)); // true var_dump(bcdiv((string)4.22,(string)0.01, 10));

preferences:
24.34 ms | 405 KiB | 5 Q