3v4l.org

run code in 500+ PHP versions simultaneously
<?php $arr = array( array('from'=>'2017-07-10 15:22:45', 'to'=>'2017-07-11 16:22:46'), array('from'=>'2017-07-11 16:22:47', 'to'=>'2017-08-05 07:10:09'), array('from'=>'2017-08-05 07:10:10', 'to'=>'2017-09-22 09:25:12'), array('from'=>'2017-09-22 09:25:15', 'to'=>'2017-10-18 08:13:58'), array('from'=>'2017-10-18 08:13:58', 'to'=>'2017-11-29 13:29:12') ); $gap = false; For($i=0; $i<count($arr)-1; $i++){ $diff = strtotime ($arr[$i+1]['from']) - strtotime ($arr[$i]['to']); If($diff >1){ $gap = true; Echo "key " . $i . " to " . ($i+1) .". Missing " .$diff . " seconds"; } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 29
Branch analysis from position: 29
2 jumps found. (Code = 44) Position 1 = 33, Position 2 = 4
Branch analysis from position: 33
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 28
Branch analysis from position: 19
2 jumps found. (Code = 44) Position 1 = 33, Position 2 = 4
Branch analysis from position: 33
Branch analysis from position: 4
Branch analysis from position: 28
filename:       /in/pNviX
function name:  (null)
number of ops:  34
compiled vars:  !0 = $arr, !1 = $gap, !2 = $i, !3 = $diff
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
   10     1        ASSIGN                                                       !1, <false>
   11     2        ASSIGN                                                       !2, 0
          3      > JMP                                                          ->29
   12     4    >   INIT_FCALL                                                   'strtotime'
          5        ADD                                                  ~7      !2, 1
          6        FETCH_DIM_R                                          ~8      !0, ~7
          7        FETCH_DIM_R                                          ~9      ~8, 'from'
          8        SEND_VAL                                                     ~9
          9        DO_ICALL                                             $10     
         10        INIT_FCALL                                                   'strtotime'
         11        FETCH_DIM_R                                          ~11     !0, !2
         12        FETCH_DIM_R                                          ~12     ~11, 'to'
         13        SEND_VAL                                                     ~12
         14        DO_ICALL                                             $13     
         15        SUB                                                  ~14     $10, $13
         16        ASSIGN                                                       !3, ~14
   13    17        IS_SMALLER                                                   1, !3
         18      > JMPZ                                                         ~16, ->28
   14    19    >   ASSIGN                                                       !1, <true>
   15    20        CONCAT                                               ~18     'key+', !2
         21        CONCAT                                               ~19     ~18, '+to+'
         22        ADD                                                  ~20     !2, 1
         23        CONCAT                                               ~21     ~19, ~20
         24        CONCAT                                               ~22     ~21, '.+Missing+'
         25        CONCAT                                               ~23     ~22, !3
         26        CONCAT                                               ~24     ~23, '+seconds'
         27        ECHO                                                         ~24
   11    28    >   PRE_INC                                                      !2
         29    >   COUNT                                                ~26     !0
         30        SUB                                                  ~27     ~26, 1
         31        IS_SMALLER                                                   !2, ~27
         32      > JMPNZ                                                        ~28, ->4
   17    33    > > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
164.93 ms | 3304 KiB | 14 Q