3v4l.org

run code in 300+ PHP versions simultaneously
<?php $start = new DateTime('2015-09-01'); $end = new DateTime('2015-09-02'); $interval = new DateInterval('P1D'); $period = new DatePeriod($start, $interval, $end); foreach ($period as $current) { $currentEnd = clone $current; $currentEnd->add($period->getDateInterval()); var_dump($current, $currentEnd); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 19, Position 2 = 32
Branch analysis from position: 19
2 jumps found. (Code = 78) Position 1 = 20, Position 2 = 32
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
Branch analysis from position: 32
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 32
filename:       /in/iD6hn
function name:  (null)
number of ops:  34
compiled vars:  !0 = $start, !1 = $end, !2 = $interval, !3 = $period, !4 = $current, !5 = $currentEnd
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $6      'DateTime'
          1        SEND_VAL_EX                                              '2015-09-01'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $6
    4     4        NEW                                              $9      'DateTime'
          5        SEND_VAL_EX                                              '2015-09-02'
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !1, $9
    5     8        NEW                                              $12     'DateInterval'
          9        SEND_VAL_EX                                              'P1D'
         10        DO_FCALL                                      0          
         11        ASSIGN                                                   !2, $12
    6    12        NEW                                              $15     'DatePeriod'
         13        SEND_VAR_EX                                              !0
         14        SEND_VAR_EX                                              !2
         15        SEND_VAR_EX                                              !1
         16        DO_FCALL                                      0          
         17        ASSIGN                                                   !3, $15
    8    18      > FE_RESET_R                                       $18     !3, ->32
         19    > > FE_FETCH_R                                               $18, !4, ->32
    9    20    >   CLONE                                            ~19     !4
         21        ASSIGN                                                   !5, ~19
   10    22        INIT_METHOD_CALL                                         !5, 'add'
         23        INIT_METHOD_CALL                                         !3, 'getDateInterval'
         24        DO_FCALL                                      0  $21     
         25        SEND_VAR_NO_REF_EX                                       $21
         26        DO_FCALL                                      0          
   11    27        INIT_FCALL                                               'var_dump'
         28        SEND_VAR                                                 !4
         29        SEND_VAR                                                 !5
         30        DO_ICALL                                                 
    8    31      > JMP                                                      ->19
         32    >   FE_FREE                                                  $18
   12    33      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.18 ms | 1396 KiB | 15 Q