3v4l.org

run code in 300+ PHP versions simultaneously
<?php $start = DateTime::createFromFormat("Y-m-d H:i:s","2011-01-01 00:00:00",new DateTimeZone("America/Toronto")); $interval = new DateInterval("P1D"); // 1 month $occurrences = 3; $period = new DatePeriod($start,$interval,$occurrences); foreach($period as $dt){ echo $dt->format("Y-m-d H:i:s") . "\n"; } foreach($period as $dt){ echo $dt->format("Y-m-d H:i:s") . "\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 21, Position 2 = 28
Branch analysis from position: 21
2 jumps found. (Code = 78) Position 1 = 22, Position 2 = 28
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
Branch analysis from position: 28
2 jumps found. (Code = 77) Position 1 = 30, Position 2 = 37
Branch analysis from position: 30
2 jumps found. (Code = 78) Position 1 = 31, Position 2 = 37
Branch analysis from position: 31
1 jumps found. (Code = 42) Position 1 = 30
Branch analysis from position: 30
Branch analysis from position: 37
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 37
Branch analysis from position: 28
filename:       /in/A8s0C
function name:  (null)
number of ops:  39
compiled vars:  !0 = $start, !1 = $interval, !2 = $occurrences, !3 = $period, !4 = $dt
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_STATIC_METHOD_CALL                                  'DateTime', 'createFromFormat'
          1        SEND_VAL                                                 'Y-m-d+H%3Ai%3As'
          2        SEND_VAL                                                 '2011-01-01+00%3A00%3A00'
          3        NEW                                              $5      'DateTimeZone'
          4        SEND_VAL_EX                                              'America%2FToronto'
          5        DO_FCALL                                      0          
          6        SEND_VAR                                                 $5
          7        DO_FCALL                                      0  $7      
          8        ASSIGN                                                   !0, $7
    4     9        NEW                                              $9      'DateInterval'
         10        SEND_VAL_EX                                              'P1D'
         11        DO_FCALL                                      0          
         12        ASSIGN                                                   !1, $9
    5    13        ASSIGN                                                   !2, 3
    6    14        NEW                                              $13     'DatePeriod'
         15        SEND_VAR_EX                                              !0
         16        SEND_VAR_EX                                              !1
         17        SEND_VAR_EX                                              !2
         18        DO_FCALL                                      0          
         19        ASSIGN                                                   !3, $13
    7    20      > FE_RESET_R                                       $16     !3, ->28
         21    > > FE_FETCH_R                                               $16, !4, ->28
    8    22    >   INIT_METHOD_CALL                                         !4, 'format'
         23        SEND_VAL_EX                                              'Y-m-d+H%3Ai%3As'
         24        DO_FCALL                                      0  $17     
         25        CONCAT                                           ~18     $17, '%0A'
         26        ECHO                                                     ~18
    7    27      > JMP                                                      ->21
         28    >   FE_FREE                                                  $16
   10    29      > FE_RESET_R                                       $19     !3, ->37
         30    > > FE_FETCH_R                                               $19, !4, ->37
   11    31    >   INIT_METHOD_CALL                                         !4, 'format'
         32        SEND_VAL_EX                                              'Y-m-d+H%3Ai%3As'
         33        DO_FCALL                                      0  $20     
         34        CONCAT                                           ~21     $20, '%0A'
         35        ECHO                                                     ~21
   10    36      > JMP                                                      ->30
         37    >   FE_FREE                                                  $19
   12    38      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.99 ms | 1399 KiB | 13 Q