3v4l.org

run code in 300+ PHP versions simultaneously
<?php $start = new DateTime(date('Y-m-d')); $start->modify('first day of this month'); $end = new DateTime('2013-12-01'); $end->modify('first day of next 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 = 28, Position 2 = 35
Branch analysis from position: 28
2 jumps found. (Code = 78) Position 1 = 29, Position 2 = 35
Branch analysis from position: 29
1 jumps found. (Code = 42) Position 1 = 28
Branch analysis from position: 28
Branch analysis from position: 35
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 35
filename:       /in/Glpht
function name:  (null)
number of ops:  37
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        INIT_FCALL                                               'date'
          2        SEND_VAL                                                 'Y-m-d'
          3        DO_ICALL                                         $6      
          4        SEND_VAR_NO_REF_EX                                       $6
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !0, $5
    3     7        INIT_METHOD_CALL                                         !0, 'modify'
          8        SEND_VAL_EX                                              'first+day+of+this+month'
          9        DO_FCALL                                      0          
    4    10        NEW                                              $10     'DateTime'
         11        SEND_VAL_EX                                              '2013-12-01'
         12        DO_FCALL                                      0          
         13        ASSIGN                                                   !1, $10
    5    14        INIT_METHOD_CALL                                         !1, 'modify'
         15        SEND_VAL_EX                                              'first+day+of+next+month'
         16        DO_FCALL                                      0          
    6    17        INIT_STATIC_METHOD_CALL                                  'DateInterval', 'createFromDateString'
         18        SEND_VAL                                                 '1+month'
         19        DO_FCALL                                      0  $14     
         20        ASSIGN                                                   !2, $14
    7    21        NEW                                              $16     'DatePeriod'
         22        SEND_VAR_EX                                              !0
         23        SEND_VAR_EX                                              !2
         24        SEND_VAR_EX                                              !1
         25        DO_FCALL                                      0          
         26        ASSIGN                                                   !3, $16
    9    27      > FE_RESET_R                                       $19     !3, ->35
         28    > > FE_FETCH_R                                               $19, !4, ->35
   10    29    >   INIT_METHOD_CALL                                         !4, 'format'
         30        SEND_VAL_EX                                              'Y-m'
         31        DO_FCALL                                      0  $20     
         32        CONCAT                                           ~21     $20, '%3Cbr%3E%0A'
         33        ECHO                                                     ~21
    9    34      > JMP                                                      ->28
         35    >   FE_FREE                                                  $19
   11    36      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.28 ms | 1396 KiB | 15 Q