3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php // Trying to output 18000 $time = 12001; // milli-seconds $time = floor($time/1000); // get it into even seconds $remainder = $time % 6; if ((bool)$remainder) { $time = ($time - $remainder + 6)*1000; } else { $time = $time*1000; } echo $time;
based on P7VMp
Output for 5.3.19 - 7.2.6
12000