3v4l.org

run code in 300+ PHP versions simultaneously
<?php $start_date = '2013-10-01'; $end_date = '2013-10-03'; $period = array(); $begin = new DateTime($start_date); $end = new DateTime($end_date); while($begin <= $end) { $period[] = $begin->format('Y-m-d'); $begin->modify('+1 day'); } print_r($period);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
2 jumps found. (Code = 44) Position 1 = 22, Position 2 = 12
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
2 jumps found. (Code = 44) Position 1 = 22, Position 2 = 12
Branch analysis from position: 22
Branch analysis from position: 12
filename:       /in/LSPRJ
function name:  (null)
number of ops:  26
compiled vars:  !0 = $start_date, !1 = $end_date, !2 = $period, !3 = $begin, !4 = $end
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '2013-10-01'
    3     1        ASSIGN                                                   !1, '2013-10-03'
    4     2        ASSIGN                                                   !2, <array>
    6     3        NEW                                              $8      'DateTime'
          4        SEND_VAR_EX                                              !0
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !3, $8
    7     7        NEW                                              $11     'DateTime'
          8        SEND_VAR_EX                                              !1
          9        DO_FCALL                                      0          
         10        ASSIGN                                                   !4, $11
    8    11      > JMP                                                      ->20
    9    12    >   INIT_METHOD_CALL                                         !3, 'format'
         13        SEND_VAL_EX                                              'Y-m-d'
         14        DO_FCALL                                      0  $15     
         15        ASSIGN_DIM                                               !2
         16        OP_DATA                                                  $15
   10    17        INIT_METHOD_CALL                                         !3, 'modify'
         18        SEND_VAL_EX                                              '%2B1+day'
         19        DO_FCALL                                      0          
    8    20    >   IS_SMALLER_OR_EQUAL                                      !3, !4
         21      > JMPNZ                                                    ~17, ->12
   13    22    >   INIT_FCALL                                               'print_r'
         23        SEND_VAR                                                 !2
         24        DO_ICALL                                                 
         25      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.47 ms | 1395 KiB | 15 Q