3v4l.org

run code in 300+ PHP versions simultaneously
<?php $now = new DateTimeImmutable('now'); $months = []; $monthcnt = 0; for ($i = 1; $i <= 12; $i++) { if (($i % 3) == 0) { $monthcnt += 3; $minus = '-' . $monthcnt . ' months'; $pq3 = $now->modify($minus); var_dump($pq3->format('m')); // switch ($pq3->format('m')) // case var_dump($pq3->format('Y')); } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 32
Branch analysis from position: 32
2 jumps found. (Code = 44) Position 1 = 34, Position 2 = 8
Branch analysis from position: 34
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 31
Branch analysis from position: 11
2 jumps found. (Code = 44) Position 1 = 34, Position 2 = 8
Branch analysis from position: 34
Branch analysis from position: 8
Branch analysis from position: 31
filename:       /in/I4EvI
function name:  (null)
number of ops:  35
compiled vars:  !0 = $now, !1 = $months, !2 = $monthcnt, !3 = $i, !4 = $minus, !5 = $pq3
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $6      'DateTimeImmutable'
          1        SEND_VAL_EX                                              'now'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $6
    4     4        ASSIGN                                                   !1, <array>
    5     5        ASSIGN                                                   !2, 0
    6     6        ASSIGN                                                   !3, 1
          7      > JMP                                                      ->32
    7     8    >   MOD                                              ~12     !3, 3
          9        IS_EQUAL                                                 ~12, 0
         10      > JMPZ                                                     ~13, ->31
    8    11    >   ASSIGN_OP                                     1          !2, 3
    9    12        CONCAT                                           ~15     '-', !2
         13        CONCAT                                           ~16     ~15, '+months'
         14        ASSIGN                                                   !4, ~16
   10    15        INIT_METHOD_CALL                                         !0, 'modify'
         16        SEND_VAR_EX                                              !4
         17        DO_FCALL                                      0  $18     
         18        ASSIGN                                                   !5, $18
   11    19        INIT_FCALL                                               'var_dump'
         20        INIT_METHOD_CALL                                         !5, 'format'
         21        SEND_VAL_EX                                              'm'
         22        DO_FCALL                                      0  $20     
         23        SEND_VAR                                                 $20
         24        DO_ICALL                                                 
   14    25        INIT_FCALL                                               'var_dump'
         26        INIT_METHOD_CALL                                         !5, 'format'
         27        SEND_VAL_EX                                              'Y'
         28        DO_FCALL                                      0  $22     
         29        SEND_VAR                                                 $22
         30        DO_ICALL                                                 
    6    31    >   PRE_INC                                                  !3
         32    >   IS_SMALLER_OR_EQUAL                                      !3, 12
         33      > JMPNZ                                                    ~25, ->8
   17    34    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.29 ms | 1396 KiB | 15 Q