3v4l.org

run code in 300+ PHP versions simultaneously
<?php $date = new DateTime('1st day of last month'); $i = new DateInterval('P1M'); $end = new DateTime('-1 year'); while ($date >= $end) { echo $date->format('Y F') . PHP_EOL; $date = $date->sub($i); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
2 jumps found. (Code = 44) Position 1 = 24, Position 2 = 13
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
2 jumps found. (Code = 44) Position 1 = 24, Position 2 = 13
Branch analysis from position: 24
Branch analysis from position: 13
filename:       /in/BIs8F
function name:  (null)
number of ops:  25
compiled vars:  !0 = $date, !1 = $i, !2 = $end
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   NEW                                              $3      'DateTime'
          1        SEND_VAL_EX                                              '1st+day+of+last+month'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $3
    3     4        NEW                                              $6      'DateInterval'
          5        SEND_VAL_EX                                              'P1M'
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !1, $6
    4     8        NEW                                              $9      'DateTime'
          9        SEND_VAL_EX                                              '-1+year'
         10        DO_FCALL                                      0          
         11        ASSIGN                                                   !2, $9
    5    12      > JMP                                                      ->22
    6    13    >   INIT_METHOD_CALL                                         !0, 'format'
         14        SEND_VAL_EX                                              'Y+F'
         15        DO_FCALL                                      0  $12     
         16        CONCAT                                           ~13     $12, '%0A'
         17        ECHO                                                     ~13
    7    18        INIT_METHOD_CALL                                         !0, 'sub'
         19        SEND_VAR_EX                                              !1
         20        DO_FCALL                                      0  $14     
         21        ASSIGN                                                   !0, $14
    5    22    >   IS_SMALLER_OR_EQUAL                                      !2, !0
         23      > JMPNZ                                                    ~16, ->13
    8    24    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.23 ms | 1394 KiB | 13 Q