3v4l.org

run code in 300+ PHP versions simultaneously
<?php $start = new DateTime(''); $end = new DateTime('-1 year'); $interval = new DateInterval('P1M'); $interval->invert =1; $period = new DatePeriod($start, $interval, $end); foreach ($period as $dt) { echo $dt->format('Y F').PHP_EOL; }
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
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 28
filename:       /in/BlNVv
function name:  (null)
number of ops:  30
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                                              ''
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $5
    3     4        NEW                                              $8      'DateTime'
          5        SEND_VAL_EX                                              '-1+year'
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !1, $8
    4     8        NEW                                              $11     'DateInterval'
          9        SEND_VAL_EX                                              'P1M'
         10        DO_FCALL                                      0          
         11        ASSIGN                                                   !2, $11
    5    12        ASSIGN_OBJ                                               !2, 'invert'
         13        OP_DATA                                                  1
    6    14        NEW                                              $15     'DatePeriod'
         15        SEND_VAR_EX                                              !0
         16        SEND_VAR_EX                                              !2
         17        SEND_VAR_EX                                              !1
         18        DO_FCALL                                      0          
         19        ASSIGN                                                   !3, $15
    8    20      > FE_RESET_R                                       $18     !3, ->28
         21    > > FE_FETCH_R                                               $18, !4, ->28
   10    22    >   INIT_METHOD_CALL                                         !4, 'format'
         23        SEND_VAL_EX                                              'Y+F'
         24        DO_FCALL                                      0  $19     
         25        CONCAT                                           ~20     $19, '%0A'
         26        ECHO                                                     ~20
    8    27      > JMP                                                      ->21
         28    >   FE_FREE                                                  $18
   11    29      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.56 ms | 1395 KiB | 13 Q