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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
177.02 ms | 1396 KiB | 17 Q