3v4l.org

run code in 300+ PHP versions simultaneously
<?php $start = new \DateTime(); $end = clone $start; $end->modify('+5 days'); $interval = $start->diff($end); $daterange = new DatePeriod($start, $interval , 1); $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 = 21, Position 2 = 29
Branch analysis from position: 21
2 jumps found. (Code = 78) Position 1 = 22, Position 2 = 29
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
Branch analysis from position: 29
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 29
filename:       /in/PQtQn
function name:  (null)
number of ops:  34
compiled vars:  !0 = $start, !1 = $end, !2 = $interval, !3 = $daterange, !4 = $return, !5 = $date
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   NEW                                              $6      'DateTime'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $6
    3     3        CLONE                                            ~9      !0
          4        ASSIGN                                                   !1, ~9
    4     5        INIT_METHOD_CALL                                         !1, 'modify'
          6        SEND_VAL_EX                                              '%2B5+days'
          7        DO_FCALL                                      0          
    5     8        INIT_METHOD_CALL                                         !0, 'diff'
          9        SEND_VAR_EX                                              !1
         10        DO_FCALL                                      0  $12     
         11        ASSIGN                                                   !2, $12
    6    12        NEW                                              $14     'DatePeriod'
         13        SEND_VAR_EX                                              !0
         14        SEND_VAR_EX                                              !2
         15        SEND_VAL_EX                                              1
         16        DO_FCALL                                      0          
         17        ASSIGN                                                   !3, $14
    8    18        ASSIGN_DIM                                               !4, 'days'
         19        OP_DATA                                                  <array>
   10    20      > FE_RESET_R                                       $18     !3, ->29
         21    > > FE_FETCH_R                                               $18, !5, ->29
   11    22    >   INIT_METHOD_CALL                                         !5, 'format'
         23        SEND_VAL_EX                                              'Y-m-d'
         24        DO_FCALL                                      0  $21     
         25        FETCH_DIM_W                                      $19     !4, 'days'
         26        ASSIGN_DIM                                               $19
         27        OP_DATA                                                  $21
   10    28      > JMP                                                      ->21
         29    >   FE_FREE                                                  $18
   14    30        INIT_FCALL                                               'var_dump'
         31        SEND_VAR                                                 !4
         32        DO_ICALL                                                 
         33      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.7 ms | 1396 KiB | 15 Q