3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo 'Using default precision:',PHP_EOL; $time = $_SERVER['REQUEST_TIME_FLOAT']; var_dump(ini_get('precision')); var_dump($time); $time_string = addslashes($time); var_dump($time_string); $recast_time = (float) $time_string; var_dump($recast_time); var_dump($time === $recast_time); echo PHP_EOL,'Using substantially higher precision:',PHP_EOL; ini_set('precision', 50); $time = $_SERVER['REQUEST_TIME_FLOAT']; var_dump(ini_get('precision')); var_dump($time); $time_string = addslashes($time); var_dump($time_string); $recast_time = (float) $time_string; var_dump($recast_time); var_dump($time === $recast_time);

preferences:
21.13 ms | 407 KiB | 5 Q