3v4l.org

run code in 300+ PHP versions simultaneously
<?php $now = (new DateTime())->setTime(0,0,30); $ts = strftime('%Y-%m-%d %H:%M:00', $now); $exists = ['jobname/' . $ts => true ]; $timeAhead = 15 * 60 + $now; $jobName = 'jobname'; for ($time = $now; $time < $timeAhead; $time += 60) { $ts = strftime('%Y-%m-%d %H:%M:00', $time); if (!empty($exists[$jobName.'/' . $ts])) { // already scheduled continue; } } echo count($exists);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 33
Branch analysis from position: 33
2 jumps found. (Code = 44) Position 1 = 35, Position 2 = 21
Branch analysis from position: 35
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
2 jumps found. (Code = 43) Position 1 = 31, Position 2 = 32
Branch analysis from position: 31
1 jumps found. (Code = 42) Position 1 = 32
Branch analysis from position: 32
2 jumps found. (Code = 44) Position 1 = 35, Position 2 = 21
Branch analysis from position: 35
Branch analysis from position: 21
Branch analysis from position: 32
filename:       /in/HoWBh
function name:  (null)
number of ops:  38
compiled vars:  !0 = $now, !1 = $ts, !2 = $exists, !3 = $timeAhead, !4 = $jobName, !5 = $time
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   NEW                                              $6      'DateTime'
          1        DO_FCALL                                      0          
          2        INIT_METHOD_CALL                                         $6, 'setTime'
          3        SEND_VAL_EX                                              0
          4        SEND_VAL_EX                                              0
          5        SEND_VAL_EX                                              30
          6        DO_FCALL                                      0  $8      
          7        ASSIGN                                                   !0, $8
    3     8        INIT_FCALL                                               'strftime'
          9        SEND_VAL                                                 '%25Y-%25m-%25d+%25H%3A%25M%3A00'
         10        SEND_VAR                                                 !0
         11        DO_ICALL                                         $10     
         12        ASSIGN                                                   !1, $10
    4    13        CONCAT                                           ~12     'jobname%2F', !1
         14        INIT_ARRAY                                       ~13     <true>, ~12
         15        ASSIGN                                                   !2, ~13
    6    16        ADD                                              ~15     900, !0
         17        ASSIGN                                                   !3, ~15
    7    18        ASSIGN                                                   !4, 'jobname'
   10    19        ASSIGN                                                   !5, !0
         20      > JMP                                                      ->33
   12    21    >   INIT_FCALL                                               'strftime'
         22        SEND_VAL                                                 '%25Y-%25m-%25d+%25H%3A%25M%3A00'
         23        SEND_VAR                                                 !5
         24        DO_ICALL                                         $19     
         25        ASSIGN                                                   !1, $19
   13    26        CONCAT                                           ~21     !4, '%2F'
         27        CONCAT                                           ~22     ~21, !1
         28        ISSET_ISEMPTY_DIM_OBJ                         1  ~23     !2, ~22
         29        BOOL_NOT                                         ~24     ~23
         30      > JMPZ                                                     ~24, ->32
   16    31    > > JMP                                                      ->32
   10    32    >   ASSIGN_OP                                     1          !5, 60
         33    >   IS_SMALLER                                               !5, !3
         34      > JMPNZ                                                    ~26, ->21
   22    35    >   COUNT                                            ~27     !2
         36        ECHO                                                     ~27
         37      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.19 ms | 1400 KiB | 15 Q