3v4l.org

run code in 300+ PHP versions simultaneously
<?php $start = new DateTime('2019-01-01'); $end = new DateTime('2019-02-27'); $interval = new DateInterval('P19D'); while ($start < $end) { echo $start->format('Y-m-d') . ' => '; $start->add($interval); echo min($start, $end)->format('Y-m-d') . "\n"; $start->add(new DateInterval('P1D')); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 36
Branch analysis from position: 36
2 jumps found. (Code = 44) Position 1 = 38, Position 2 = 13
Branch analysis from position: 38
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
2 jumps found. (Code = 44) Position 1 = 38, Position 2 = 13
Branch analysis from position: 38
Branch analysis from position: 13
filename:       /in/a12nL
function name:  (null)
number of ops:  39
compiled vars:  !0 = $start, !1 = $end, !2 = $interval
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   NEW                                              $3      'DateTime'
          1        SEND_VAL_EX                                              '2019-01-01'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $3
    3     4        NEW                                              $6      'DateTime'
          5        SEND_VAL_EX                                              '2019-02-27'
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !1, $6
    4     8        NEW                                              $9      'DateInterval'
          9        SEND_VAL_EX                                              'P19D'
         10        DO_FCALL                                      0          
         11        ASSIGN                                                   !2, $9
    5    12      > JMP                                                      ->36
    6    13    >   INIT_METHOD_CALL                                         !0, 'format'
         14        SEND_VAL_EX                                              'Y-m-d'
         15        DO_FCALL                                      0  $12     
         16        CONCAT                                           ~13     $12, '+%3D%3E+'
         17        ECHO                                                     ~13
    7    18        INIT_METHOD_CALL                                         !0, 'add'
         19        SEND_VAR_EX                                              !2
         20        DO_FCALL                                      0          
    8    21        INIT_FCALL                                               'min'
         22        SEND_VAR                                                 !0
         23        SEND_VAR                                                 !1
         24        DO_ICALL                                         $15     
         25        INIT_METHOD_CALL                                         $15, 'format'
         26        SEND_VAL_EX                                              'Y-m-d'
         27        DO_FCALL                                      0  $16     
         28        CONCAT                                           ~17     $16, '%0A'
         29        ECHO                                                     ~17
    9    30        INIT_METHOD_CALL                                         !0, 'add'
         31        NEW                                              $18     'DateInterval'
         32        SEND_VAL_EX                                              'P1D'
         33        DO_FCALL                                      0          
         34        SEND_VAR_NO_REF_EX                                       $18
         35        DO_FCALL                                      0          
    5    36    >   IS_SMALLER                                               !0, !1
         37      > JMPNZ                                                    ~21, ->13
   10    38    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.81 ms | 1001 KiB | 14 Q