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); echo $date2; 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 = 28
Branch analysis from position: 13
2 jumps found. (Code = 78) Position 1 = 14, Position 2 = 28
Branch analysis from position: 14
2 jumps found. (Code = 46) Position 1 = 22, Position 2 = 24
Branch analysis from position: 22
2 jumps found. (Code = 43) Position 1 = 25, Position 2 = 27
Branch analysis from position: 25
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
Branch analysis from position: 27
Branch analysis from position: 24
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 28
filename:       /in/WN3pV
function name:  (null)
number of ops:  33
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, ->28
         13    > > FE_FETCH_R                                               $12, !4, ->28
    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        ECHO                                                     !5
    9    20        IS_SMALLER_OR_EQUAL                              ~15     !0, !5
         21      > JMPZ_EX                                          ~15     ~15, ->24
         22    >   IS_SMALLER_OR_EQUAL                              ~16     !5, !1
         23        BOOL                                             ~15     ~16
         24    > > JMPZ                                                     ~15, ->27
   10    25    >   ASSIGN_DIM                                               !3
         26        OP_DATA                                                  !4
    6    27    > > JMP                                                      ->13
         28    >   FE_FREE                                                  $12
   13    29        INIT_FCALL                                               'print_r'
         30        SEND_VAR                                                 !3
         31        DO_ICALL                                                 
         32      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.07 ms | 1396 KiB | 15 Q