3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
129.01 ms | 1435 KiB | 13 Q