3v4l.org

run code in 500+ PHP versions simultaneously
<?php $prop['created_date'] = '2022-04-07 13:38:15.000000'; $obj['files'] = [ ["20220407_10_22_30_L100.SVL", 2, "20220407", 4766, 307, 101366, "2022-04-07 13:24:10"], ["20220407_10_22_30_L101.SVL", 3, "20220407", 4767, 308, 101367, "2022-04-07 13:29:10"], ["20220407_10_22_30_L102.SVL", 4, "20220407", 4768, 309, 101368, "2022-04-07 13:34:10"], ["20220407_10_22_30_L103.SVL", 5, "20220407", 4769, 310, 101369, "2022-04-07 13:39:10"], ["20220407_10_22_30_L104.SVL", 6, "20220407", 4770, 311, 101370, "2022-04-07 13:44:10"], ["20220407_10_22_30_L105.SVL", 7, "20220407", 4771, 312, 101371, "2022-04-07 13:49:10"], ]; // prepare the date range data only once, before looping $from = date('Y-m-d H:i:s', strtotime($prop['created_date'] . ' - 10 minutes')); $to = date('Y-m-d H:i:s', strtotime($prop['created_date'] . ' + 10 minutes')); $result =[]; foreach ($obj['files'] as $file) { if ($from <= $file[6] && $file[6] <= $to) { $result[] = [$file[0], $file[6]]; } } var_export($result);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 27, Position 2 = 42
Branch analysis from position: 27
2 jumps found. (Code = 78) Position 1 = 28, Position 2 = 42
Branch analysis from position: 28
2 jumps found. (Code = 46) Position 1 = 31, Position 2 = 34
Branch analysis from position: 31
2 jumps found. (Code = 43) Position 1 = 35, Position 2 = 41
Branch analysis from position: 35
1 jumps found. (Code = 42) Position 1 = 27
Branch analysis from position: 27
Branch analysis from position: 41
Branch analysis from position: 34
Branch analysis from position: 42
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 42
filename:       /in/7Qan0
function name:  (null)
number of ops:  47
compiled vars:  !0 = $prop, !1 = $obj, !2 = $from, !3 = $to, !4 = $result, !5 = $file
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN_DIM                                                   !0, 'created_date'
          1        OP_DATA                                                      '2022-04-07+13%3A38%3A15.000000'
    5     2        ASSIGN_DIM                                                   !1, 'files'
    6     3        OP_DATA                                                      <array>
   15     4        INIT_FCALL                                                   'date'
          5        SEND_VAL                                                     'Y-m-d+H%3Ai%3As'
          6        INIT_FCALL                                                   'strtotime'
          7        FETCH_DIM_R                                          ~8      !0, 'created_date'
          8        CONCAT                                               ~9      ~8, '+-+10+minutes'
          9        SEND_VAL                                                     ~9
         10        DO_ICALL                                             $10     
         11        SEND_VAR                                                     $10
         12        DO_ICALL                                             $11     
         13        ASSIGN                                                       !2, $11
   16    14        INIT_FCALL                                                   'date'
         15        SEND_VAL                                                     'Y-m-d+H%3Ai%3As'
         16        INIT_FCALL                                                   'strtotime'
         17        FETCH_DIM_R                                          ~13     !0, 'created_date'
         18        CONCAT                                               ~14     ~13, '+%2B+10+minutes'
         19        SEND_VAL                                                     ~14
         20        DO_ICALL                                             $15     
         21        SEND_VAR                                                     $15
         22        DO_ICALL                                             $16     
         23        ASSIGN                                                       !3, $16
   18    24        ASSIGN                                                       !4, <array>
   19    25        FETCH_DIM_R                                          ~19     !1, 'files'
         26      > FE_RESET_R                                           $20     ~19, ->42
         27    > > FE_FETCH_R                                                   $20, !5, ->42
   20    28    >   FETCH_DIM_R                                          ~21     !5, 6
         29        IS_SMALLER_OR_EQUAL                                  ~22     !2, ~21
         30      > JMPZ_EX                                              ~22     ~22, ->34
         31    >   FETCH_DIM_R                                          ~23     !5, 6
         32        IS_SMALLER_OR_EQUAL                                  ~24     ~23, !3
         33        BOOL                                                 ~22     ~24
         34    > > JMPZ                                                         ~22, ->41
   21    35    >   FETCH_DIM_R                                          ~26     !5, 0
         36        INIT_ARRAY                                           ~27     ~26
         37        FETCH_DIM_R                                          ~28     !5, 6
         38        ADD_ARRAY_ELEMENT                                    ~27     ~28
         39        ASSIGN_DIM                                                   !4
         40        OP_DATA                                                      ~27
   19    41    > > JMP                                                          ->27
         42    >   FE_FREE                                                      $20
   24    43        INIT_FCALL                                                   'var_export'
         44        SEND_VAR                                                     !4
         45        DO_ICALL                                                     
         46      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
165 ms | 2016 KiB | 16 Q