3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.87 ms | 1400 KiB | 15 Q