3v4l.org

run code in 300+ PHP versions simultaneously
<?php $n = 50.853; $whole = intval($n); $fraction = $n * 100 % 100; var_dump($whole); var_dump($fraction);
Output for 8.1.0 - 8.1.27, 8.2.0 - 8.2.17, 8.3.0 - 8.3.4
Deprecated: Implicit conversion from float 5085.3 to int loses precision in /in/An9gO on line 5 int(50) int(85)
Output for 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30
int(50) int(85)

preferences:
141.76 ms | 402 KiB | 152 Q