3v4l.org

run code in 300+ PHP versions simultaneously
<?php $start = DateTime::createFromFormat('d-m-Y', '25-12-2013'); $end = DateTime::createFromFormat('d-m-Y', '26-12-2013'); $dates = array('24-12-2013','25-12-2013','26-12-2014','27-12-2013'); $matches = array(); foreach ($dates as $date) { $date2 = DateTime::createFromFormat('d-m-Y', $date); if ($date2 >= $start && $date2 <= $end) { $matches[] = $date; } } print_r($matches);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 13, Position 2 = 27
Branch analysis from position: 13
2 jumps found. (Code = 78) Position 1 = 14, Position 2 = 27
Branch analysis from position: 14
2 jumps found. (Code = 46) Position 1 = 21, Position 2 = 23
Branch analysis from position: 21
2 jumps found. (Code = 43) Position 1 = 24, Position 2 = 26
Branch analysis from position: 24
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
Branch analysis from position: 26
Branch analysis from position: 23
Branch analysis from position: 27
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 27
filename:       /in/tJmLL
function name:  (null)
number of ops:  32
compiled vars:  !0 = $start, !1 = $end, !2 = $dates, !3 = $matches, !4 = $date, !5 = $date2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_STATIC_METHOD_CALL                                  'DateTime', 'createFromFormat'
          1        SEND_VAL                                                 'd-m-Y'
          2        SEND_VAL                                                 '25-12-2013'
          3        DO_FCALL                                      0  $6      
          4        ASSIGN                                                   !0, $6
    3     5        INIT_STATIC_METHOD_CALL                                  'DateTime', 'createFromFormat'
          6        SEND_VAL                                                 'd-m-Y'
          7        SEND_VAL                                                 '26-12-2013'
          8        DO_FCALL                                      0  $8      
          9        ASSIGN                                                   !1, $8
    4    10        ASSIGN                                                   !2, <array>
    5    11        ASSIGN                                                   !3, <array>
    6    12      > FE_RESET_R                                       $12     !2, ->27
         13    > > FE_FETCH_R                                               $12, !4, ->27
    7    14    >   INIT_STATIC_METHOD_CALL                                  'DateTime', 'createFromFormat'
         15        SEND_VAL                                                 'd-m-Y'
         16        SEND_VAR                                                 !4
         17        DO_FCALL                                      0  $13     
         18        ASSIGN                                                   !5, $13
    8    19        IS_SMALLER_OR_EQUAL                              ~15     !0, !5
         20      > JMPZ_EX                                          ~15     ~15, ->23
         21    >   IS_SMALLER_OR_EQUAL                              ~16     !5, !1
         22        BOOL                                             ~15     ~16
         23    > > JMPZ                                                     ~15, ->26
    9    24    >   ASSIGN_DIM                                               !3
         25        OP_DATA                                                  !4
    6    26    > > JMP                                                      ->13
         27    >   FE_FREE                                                  $12
   12    28        INIT_FCALL                                               'print_r'
         29        SEND_VAR                                                 !3
         30        DO_ICALL                                                 
         31      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.91 ms | 1401 KiB | 15 Q