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));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/v4Jbt
function name:  (null)
number of ops:  22
compiled vars:  !0 = $time, !1 = $const, !2 = $act_time, !3 = $lst_time
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   INIT_FCALL                                               'time'
          1        DO_ICALL                                         $4      
          2        ASSIGN                                                   !0, $4
    8     3        ASSIGN                                                   !1, 210
   11     4        INIT_FCALL                                               'md5'
          5        INIT_FCALL                                               'ceil300'
          6        SEND_VAR                                                 !0
          7        SEND_VAL                                                 210
          8        DO_FCALL                                      0  $7      
          9        SEND_VAR                                                 $7
         10        DO_ICALL                                         $8      
         11        ASSIGN                                                   !2, $8
   12    12        INIT_FCALL                                               'md5'
         13        INIT_FCALL                                               'ceil300'
         14        SUB                                              ~10     !0, 300
         15        SEND_VAL                                                 ~10
         16        SEND_VAL                                                 210
         17        DO_FCALL                                      0  $11     
         18        SEND_VAR                                                 $11
         19        DO_ICALL                                         $12     
         20        ASSIGN                                                   !3, $12
         21      > RETURN                                                   1

Function ceil300:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 7
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/v4Jbt
function name:  ceil300
number of ops:  13
compiled vars:  !0 = $time, !1 = $const
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    3     2        MOD                                              ~2      !0, 300
          3        IS_EQUAL                                                 ~2, 0
          4      > JMPZ                                                     ~3, ->7
          5    >   ADD                                              ~4      !0, !1
          6      > RETURN                                                   ~4
    4     7    >   MOD                                              ~5      !0, 300
          8        SUB                                              ~6      300, ~5
          9        ADD                                              ~7      !0, ~6
         10        ADD                                              ~8      ~7, !1
         11      > RETURN                                                   ~8
    5    12*     > RETURN                                                   null

End of function ceil300

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.56 ms | 1399 KiB | 19 Q