3v4l.org

run code in 300+ PHP versions simultaneously
<?php $now = new DateTime( "7 days ago"); $yourInterval= new DateInterval( 'P1D'); $yorPeriodOfSevenDays= new DatePeriod( $now, $interval, 7); foreach($yorPeriodOfSevenDays as $day) { $date = $day->format( 'd-m-Y'); $resultArray[] = $date ; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 15, Position 2 = 23
Branch analysis from position: 15
2 jumps found. (Code = 78) Position 1 = 16, Position 2 = 23
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 23
filename:       /in/fKYI7
function name:  (null)
number of ops:  25
compiled vars:  !0 = $now, !1 = $yourInterval, !2 = $yorPeriodOfSevenDays, !3 = $interval, !4 = $day, !5 = $date, !6 = $resultArray
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $7      'DateTime'
          1        SEND_VAL_EX                                              '7+days+ago'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $7
    4     4        NEW                                              $10     'DateInterval'
          5        SEND_VAL_EX                                              'P1D'
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !1, $10
    5     8        NEW                                              $13     'DatePeriod'
          9        SEND_VAR_EX                                              !0
         10        SEND_VAR_EX                                              !3
         11        SEND_VAL_EX                                              7
         12        DO_FCALL                                      0          
         13        ASSIGN                                                   !2, $13
    8    14      > FE_RESET_R                                       $16     !2, ->23
         15    > > FE_FETCH_R                                               $16, !4, ->23
    9    16    >   INIT_METHOD_CALL                                         !4, 'format'
         17        SEND_VAL_EX                                              'd-m-Y'
         18        DO_FCALL                                      0  $17     
         19        ASSIGN                                                   !5, $17
   10    20        ASSIGN_DIM                                               !6
         21        OP_DATA                                                  !5
    8    22      > JMP                                                      ->15
         23    >   FE_FREE                                                  $16
   11    24      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.16 ms | 1394 KiB | 13 Q