3v4l.org

run code in 300+ PHP versions simultaneously
<?php $dat = ["2020-02-01", "2020-02-05", "2020-02-10", "20-02-12", "2020-02-15"]; $word = ["Attend To,Explore,Unaided,dull,bad"]; $words = explode(',', $word[0]); //User input $start = "2020-01-01"; $end = "2020-02-07"; $result = []; foreach ($dat as $index => $date) { if ($date >= $start && $date <= $end) { $result[] = $words[$index]; } } var_export($result);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 12, Position 2 = 23
Branch analysis from position: 12
2 jumps found. (Code = 78) Position 1 = 13, Position 2 = 23
Branch analysis from position: 13
2 jumps found. (Code = 46) Position 1 = 16, Position 2 = 18
Branch analysis from position: 16
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 22
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
Branch analysis from position: 22
Branch analysis from position: 18
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 23
filename:       /in/X1ZED
function name:  (null)
number of ops:  28
compiled vars:  !0 = $dat, !1 = $word, !2 = $words, !3 = $start, !4 = $end, !5 = $result, !6 = $date, !7 = $index
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, <array>
    5     2        INIT_FCALL                                               'explode'
          3        SEND_VAL                                                 '%2C'
          4        FETCH_DIM_R                                      ~10     !1, 0
          5        SEND_VAL                                                 ~10
          6        DO_ICALL                                         $11     
          7        ASSIGN                                                   !2, $11
    8     8        ASSIGN                                                   !3, '2020-01-01'
    9     9        ASSIGN                                                   !4, '2020-02-07'
   11    10        ASSIGN                                                   !5, <array>
   12    11      > FE_RESET_R                                       $16     !0, ->23
         12    > > FE_FETCH_R                                       ~17     $16, !6, ->23
         13    >   ASSIGN                                                   !7, ~17
   13    14        IS_SMALLER_OR_EQUAL                              ~19     !3, !6
         15      > JMPZ_EX                                          ~19     ~19, ->18
         16    >   IS_SMALLER_OR_EQUAL                              ~20     !6, !4
         17        BOOL                                             ~19     ~20
         18    > > JMPZ                                                     ~19, ->22
   14    19    >   FETCH_DIM_R                                      ~22     !2, !7
         20        ASSIGN_DIM                                               !5
         21        OP_DATA                                                  ~22
   12    22    > > JMP                                                      ->12
         23    >   FE_FREE                                                  $16
   17    24        INIT_FCALL                                               'var_export'
         25        SEND_VAR                                                 !5
         26        DO_ICALL                                                 
         27      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.24 ms | 1396 KiB | 17 Q