3v4l.org

run code in 300+ PHP versions simultaneously
<?php $date = new DateTime(''); $date->modify('1st day of 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 = 25
Branch analysis from position: 25
2 jumps found. (Code = 44) Position 1 = 27, Position 2 = 16
Branch analysis from position: 27
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
2 jumps found. (Code = 44) Position 1 = 27, Position 2 = 16
Branch analysis from position: 27
Branch analysis from position: 16
filename:       /in/AA0NE
function name:  (null)
number of ops:  28
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                                              ''
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $3
    3     4        INIT_METHOD_CALL                                         !0, 'modify'
          5        SEND_VAL_EX                                              '1st+day+of+month'
          6        DO_FCALL                                      0          
    4     7        NEW                                              $7      'DateInterval'
          8        SEND_VAL_EX                                              'P1M'
          9        DO_FCALL                                      0          
         10        ASSIGN                                                   !1, $7
    5    11        NEW                                              $10     'DateTime'
         12        SEND_VAL_EX                                              '-1+year'
         13        DO_FCALL                                      0          
         14        ASSIGN                                                   !2, $10
    6    15      > JMP                                                      ->25
    7    16    >   INIT_METHOD_CALL                                         !0, 'format'
         17        SEND_VAL_EX                                              'Y+F'
         18        DO_FCALL                                      0  $13     
         19        CONCAT                                           ~14     $13, '%0A'
         20        ECHO                                                     ~14
    8    21        INIT_METHOD_CALL                                         !0, 'sub'
         22        SEND_VAR_EX                                              !1
         23        DO_FCALL                                      0  $15     
         24        ASSIGN                                                   !0, $15
    6    25    >   IS_SMALLER_OR_EQUAL                                      !2, !0
         26      > JMPNZ                                                    ~17, ->16
    9    27    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.94 ms | 1394 KiB | 13 Q