3v4l.org

run code in 300+ PHP versions simultaneously
<?php $start = new DateTime('2012-07-01'); $interval = new DateInterval('P7D'); $end = new DateTime('2012-07-31'); echo 'Exclude start date' . PHP_EOL; $period = new DatePeriod($start, $interval, $end, DatePeriod::EXCLUDE_START_DATE); foreach ($period as $date) { echo $date->format('Y-m-d') . PHP_EOL; } echo 'Include start date' . PHP_EOL; $period = new DatePeriod($start, $interval, $end); foreach ($period as $date) { echo $date->format('Y-m-d') . PHP_EOL; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 21, Position 2 = 28
Branch analysis from position: 21
2 jumps found. (Code = 78) Position 1 = 22, Position 2 = 28
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
Branch analysis from position: 28
2 jumps found. (Code = 77) Position 1 = 37, Position 2 = 44
Branch analysis from position: 37
2 jumps found. (Code = 78) Position 1 = 38, Position 2 = 44
Branch analysis from position: 38
1 jumps found. (Code = 42) Position 1 = 37
Branch analysis from position: 37
Branch analysis from position: 44
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 44
Branch analysis from position: 28
filename:       /in/bWeOq
function name:  (null)
number of ops:  46
compiled vars:  !0 = $start, !1 = $interval, !2 = $end, !3 = $period, !4 = $date
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   3     0  E >   NEW                                              $5      :87
         1        SEND_VAL_EX                                              '2012-07-01'
         2        DO_FCALL                                      0          
         3        ASSIGN                                                   !0, $5
   4     4        NEW                                              $8      :82
         5        SEND_VAL_EX                                              'P7D'
         6        DO_FCALL                                      0          
         7        ASSIGN                                                   !1, $8
   5     8        NEW                                              $11     :77
         9        SEND_VAL_EX                                              '2012-07-31'
        10        DO_FCALL                                      0          
        11        ASSIGN                                                   !2, $11
   7    12        ECHO                                                     'Exclude+start+date%0A'
   8    13        NEW                                              $14     :71
        14        SEND_VAR_EX                                              !0
        15        SEND_VAR_EX                                              !1
        16        SEND_VAR_EX                                              !2
        17        SEND_VAL_EX                                              1
        18        DO_FCALL                                      0          
        19        ASSIGN                                                   !3, $14
   9    20      > FE_RESET_R                                       $17     !3, ->28
        21    > > FE_FETCH_R                                               $17, !4, ->28
  10    22    >   INIT_METHOD_CALL                                         !4, 'format'
        23        SEND_VAL_EX                                              'Y-m-d'
        24        DO_FCALL                                      0  $18     
        25        CONCAT                                           ~19     $18, '%0A'
        26        ECHO                                                     ~19
   9    27      > JMP                                                      ->21
        28    >   FE_FREE                                                  $17
  13    29        ECHO                                                     'Include+start+date%0A'
  14    30        NEW                                              $20     :45
        31        SEND_VAR_EX                                              !0
        32        SEND_VAR_EX                                              !1
        33        SEND_VAR_EX                                              !2
        34        DO_FCALL                                      0          
        35        ASSIGN                                                   !3, $20
  15    36      > FE_RESET_R                                       $23     !3, ->44
        37    > > FE_FETCH_R                                               $23, !4, ->44
  16    38    >   INIT_METHOD_CALL                                         !4, 'format'
        39        SEND_VAL_EX                                              'Y-m-d'
        40        DO_FCALL                                      0  $24     
        41        CONCAT                                           ~25     $24, '%0A'
        42        ECHO                                                     ~25
  15    43      > JMP                                                      ->37
        44    >   FE_FREE                                                  $23
  17    45      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
13.71 ms | 467 KiB | 7 Q