3v4l.org

run code in 300+ PHP versions simultaneously
<?php $start = new DateTime('first day'); $interval = new DateInterval('P1M'); $end = clone $start; $end->add(new DateInterval('P1Y')); $period = new DatePeriod($start, $interval, $end); foreach ($period as $date) { echo $date->format('F Y')."\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 23, Position 2 = 30
Branch analysis from position: 23
2 jumps found. (Code = 78) Position 1 = 24, Position 2 = 30
Branch analysis from position: 24
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
Branch analysis from position: 30
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 30
filename:       /in/W1XVk
function name:  (null)
number of ops:  32
compiled vars:  !0 = $start, !1 = $interval, !2 = $end, !3 = $period, !4 = $date
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $5      'DateTime'
          1        SEND_VAL_EX                                              'first+day'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $5
    4     4        NEW                                              $8      'DateInterval'
          5        SEND_VAL_EX                                              'P1M'
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !1, $8
    5     8        CLONE                                            ~11     !0
          9        ASSIGN                                                   !2, ~11
    6    10        INIT_METHOD_CALL                                         !2, 'add'
         11        NEW                                              $13     'DateInterval'
         12        SEND_VAL_EX                                              'P1Y'
         13        DO_FCALL                                      0          
         14        SEND_VAR_NO_REF_EX                                       $13
         15        DO_FCALL                                      0          
    7    16        NEW                                              $16     'DatePeriod'
         17        SEND_VAR_EX                                              !0
         18        SEND_VAR_EX                                              !1
         19        SEND_VAR_EX                                              !2
         20        DO_FCALL                                      0          
         21        ASSIGN                                                   !3, $16
    9    22      > FE_RESET_R                                       $19     !3, ->30
         23    > > FE_FETCH_R                                               $19, !4, ->30
   10    24    >   INIT_METHOD_CALL                                         !4, 'format'
         25        SEND_VAL_EX                                              'F+Y'
         26        DO_FCALL                                      0  $20     
         27        CONCAT                                           ~21     $20, '%0A'
         28        ECHO                                                     ~21
    9    29      > JMP                                                      ->23
         30    >   FE_FREE                                                  $19
   11    31      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.48 ms | 1395 KiB | 13 Q