3v4l.org

run code in 300+ PHP versions simultaneously
<?php $date = new DateTime(); $dateBegin = $date->modify('+1 year'); $dateEnd = $date->modify('+7 day');; $dateInterval = \DateInterval::createFromDateString('1 day'); $daterange = new \DatePeriod($dateBegin, $dateInterval, $dateEnd); $return['days'] = array(); foreach($daterange as $date){ $return['days'][] = $date->format("Y-m-d"); } var_dump($return);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 24, Position 2 = 32
Branch analysis from position: 24
2 jumps found. (Code = 78) Position 1 = 25, Position 2 = 32
Branch analysis from position: 25
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
Branch analysis from position: 32
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 32
filename:       /in/E078Q
function name:  (null)
number of ops:  37
compiled vars:  !0 = $date, !1 = $dateBegin, !2 = $dateEnd, !3 = $dateInterval, !4 = $daterange, !5 = $return
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   NEW                                              $6      'DateTime'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $6
    4     3        INIT_METHOD_CALL                                         !0, 'modify'
          4        SEND_VAL_EX                                              '%2B1+year'
          5        DO_FCALL                                      0  $9      
          6        ASSIGN                                                   !1, $9
    5     7        INIT_METHOD_CALL                                         !0, 'modify'
          8        SEND_VAL_EX                                              '%2B7+day'
          9        DO_FCALL                                      0  $11     
         10        ASSIGN                                                   !2, $11
    6    11        INIT_STATIC_METHOD_CALL                                  'DateInterval', 'createFromDateString'
         12        SEND_VAL                                                 '1+day'
         13        DO_FCALL                                      0  $13     
         14        ASSIGN                                                   !3, $13
    7    15        NEW                                              $15     'DatePeriod'
         16        SEND_VAR_EX                                              !1
         17        SEND_VAR_EX                                              !3
         18        SEND_VAR_EX                                              !2
         19        DO_FCALL                                      0          
         20        ASSIGN                                                   !4, $15
    9    21        ASSIGN_DIM                                               !5, 'days'
         22        OP_DATA                                                  <array>
   11    23      > FE_RESET_R                                       $19     !4, ->32
         24    > > FE_FETCH_R                                               $19, !0, ->32
   12    25    >   INIT_METHOD_CALL                                         !0, 'format'
         26        SEND_VAL_EX                                              'Y-m-d'
         27        DO_FCALL                                      0  $22     
         28        FETCH_DIM_W                                      $20     !5, 'days'
         29        ASSIGN_DIM                                               $20
         30        OP_DATA                                                  $22
   11    31      > JMP                                                      ->24
         32    >   FE_FREE                                                  $19
   15    33        INIT_FCALL                                               'var_dump'
         34        SEND_VAR                                                 !5
         35        DO_ICALL                                                 
         36      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.09 ms | 1396 KiB | 15 Q