3v4l.org

run code in 300+ PHP versions simultaneously
<?php $now = new DateTime( "7 days ago"); $yourInterval= new DateInterval( 'P1D'); $yorPeriodOfSevenDays= new DatePeriod( $now, $yourInterval, 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/0cTS6
function name:  (null)
number of ops:  25
compiled vars:  !0 = $now, !1 = $yourInterval, !2 = $yorPeriodOfSevenDays, !3 = $day, !4 = $date, !5 = $resultArray
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $6      'DateTime'
          1        SEND_VAL_EX                                              '7+days+ago'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $6
    4     4        NEW                                              $9      'DateInterval'
          5        SEND_VAL_EX                                              'P1D'
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !1, $9
    5     8        NEW                                              $12     'DatePeriod'
          9        SEND_VAR_EX                                              !0
         10        SEND_VAR_EX                                              !1
         11        SEND_VAL_EX                                              7
         12        DO_FCALL                                      0          
         13        ASSIGN                                                   !2, $12
    8    14      > FE_RESET_R                                       $15     !2, ->23
         15    > > FE_FETCH_R                                               $15, !3, ->23
    9    16    >   INIT_METHOD_CALL                                         !3, 'format'
         17        SEND_VAL_EX                                              'd-m-Y'
         18        DO_FCALL                                      0  $16     
         19        ASSIGN                                                   !4, $16
   10    20        ASSIGN_DIM                                               !5
         21        OP_DATA                                                  !4
    8    22      > JMP                                                      ->15
         23    >   FE_FREE                                                  $15
   11    24      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.87 ms | 1398 KiB | 13 Q