3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $float = 500.10; var_dump(gettype($float), $float, gettype($float) == 'float', (float) $float, // Cast to float (int) $float); // Cast to integer $float = (float) 500.10; // Can only be decimal numbers. var_dump(gettype($float), $float, gettype($float) == 'float', (float) $float, // Cast to float (int) $float); // Cast to integer
Output for 4.3.0 - 5.0.5, 5.1.1 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
string(6) "double" float(500.1) bool(false) float(500.1) int(500) string(6) "double" float(500.1) bool(false) float(500.1) int(500)
Output for 5.1.0
Fatal error: fatal flex scanner internal error--end of buffer missed in /in/OvvV6 on line 19
Process exited with code 255.