3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $input =0.58333333333334; $hour = intval(24*$input); Var_dump($hour); $fraction = $hour-floor($hour); Echo $hour . " " . $fraction; // Echo $hour .":". Str_replace(".",":",((24*$input)-$hour)*60);
based on Od8pY
Output for 5.6.0 - 5.6.30, hhvm-3.18.5 - 3.22.0, 7.0.0 - 7.3.0beta1
int(14) 14 0