3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function ceil300($time,$const) { // function returns timestamp rounded to next 300 seconds ( 5 minutes ) + const if ($time % 300 == 0) return $time + $const; return $time + (300 - ($time % 300)) + $const; } $time = time(); $const = 210; // 210 seconds = 3:30 // getting actual time and constant $act_time = md5(ceil300($time,210)); $lst_time = md5(ceil300($time-300,210)); echo $act_time ."<br>"; echo $lst_time;
Output for 4.3.0 - 7.1.0
889a870a09162ea975774ca05dbf9909<br>a4eca190b849f5d3ed23f24c26b8ca60