3v4l.org

run code in 300+ PHP versions simultaneously
<?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;

preferences:
37.61 ms | 402 KiB | 5 Q