3v4l.org

run code in 300+ PHP versions simultaneously
<?php $start = (new DateTime('2010-12-02'))->modify('first day of this month'); $end = (new DateTime('2012-05-06'))->modify('first day of this month'); $interval = DateInterval::createFromDateString('1 month'); $period = new DatePeriod($start, $interval, $end); foreach ($period as $dt) { echo $dt->format("Y-m") . "<br>\n"; }
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/IKgMc
function name:  (null)
number of ops:  34
compiled vars:  !0 = $start, !1 = $end, !2 = $interval, !3 = $period, !4 = $dt
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   NEW                                              $5      'DateTime'
          1        SEND_VAL_EX                                              '2010-12-02'
          2        DO_FCALL                                      0          
          3        INIT_METHOD_CALL                                         $5, 'modify'
          4        SEND_VAL_EX                                              'first+day+of+this+month'
          5        DO_FCALL                                      0  $7      
          6        ASSIGN                                                   !0, $7
    3     7        NEW                                              $9      'DateTime'
          8        SEND_VAL_EX                                              '2012-05-06'
          9        DO_FCALL                                      0          
         10        INIT_METHOD_CALL                                         $9, 'modify'
         11        SEND_VAL_EX                                              'first+day+of+this+month'
         12        DO_FCALL                                      0  $11     
         13        ASSIGN                                                   !1, $11
    4    14        INIT_STATIC_METHOD_CALL                                  'DateInterval', 'createFromDateString'
         15        SEND_VAL                                                 '1+month'
         16        DO_FCALL                                      0  $13     
         17        ASSIGN                                                   !2, $13
    5    18        NEW                                              $15     'DatePeriod'
         19        SEND_VAR_EX                                              !0
         20        SEND_VAR_EX                                              !2
         21        SEND_VAR_EX                                              !1
         22        DO_FCALL                                      0          
         23        ASSIGN                                                   !3, $15
    7    24      > FE_RESET_R                                       $18     !3, ->32
         25    > > FE_FETCH_R                                               $18, !4, ->32
    8    26    >   INIT_METHOD_CALL                                         !4, 'format'
         27        SEND_VAL_EX                                              'Y-m'
         28        DO_FCALL                                      0  $19     
         29        CONCAT                                           ~20     $19, '%3Cbr%3E%0A'
         30        ECHO                                                     ~20
    7    31      > JMP                                                      ->25
         32    >   FE_FREE                                                  $18
    9    33      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
170.04 ms | 1395 KiB | 13 Q