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("P1M"); // 1 month $period = new DatePeriod($start,$interval); 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 = 19, Position 2 = 26
Branch analysis from position: 19
2 jumps found. (Code = 78) Position 1 = 20, Position 2 = 26
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 26
filename:       /in/mXOTY
function name:  (null)
number of ops:  28
compiled vars:  !0 = $start, !1 = $interval, !2 = $period, !3 = $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                                              $4      'DateTimeZone'
          4        SEND_VAL_EX                                              'America%2FToronto'
          5        DO_FCALL                                      0          
          6        SEND_VAR                                                 $4
          7        DO_FCALL                                      0  $6      
          8        ASSIGN                                                   !0, $6
    4     9        NEW                                              $8      'DateInterval'
         10        SEND_VAL_EX                                              'P1M'
         11        DO_FCALL                                      0          
         12        ASSIGN                                                   !1, $8
    5    13        NEW                                              $11     'DatePeriod'
         14        SEND_VAR_EX                                              !0
         15        SEND_VAR_EX                                              !1
         16        DO_FCALL                                      0          
         17        ASSIGN                                                   !2, $11
    6    18      > FE_RESET_R                                       $14     !2, ->26
         19    > > FE_FETCH_R                                               $14, !3, ->26
    7    20    >   INIT_METHOD_CALL                                         !3, 'format'
         21        SEND_VAL_EX                                              'Y-m-d+H%3Ai%3As'
         22        DO_FCALL                                      0  $15     
         23        CONCAT                                           ~16     $15, '%0A'
         24        ECHO                                                     ~16
    6    25      > JMP                                                      ->19
         26    >   FE_FREE                                                  $14
    8    27      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.42 ms | 1395 KiB | 13 Q