3v4l.org

run code in 300+ PHP versions simultaneously
<?php $now = new DateTimeImmutable('now'); $months = []; $monthcnt = 0; $label = ""; for ($i = 1; $i <= 12; $i++) { if (($i % 3) == 0) { $monthcnt += 3; $minus = '-' . $monthcnt . ' months'; $pq3 = $now->modify($minus); switch ($pq3->format('m')) { case 01: $label = 'Q1 ' . $pq3->format('Y'); break; case 04: $label = 'Q2 ' . $pq3->format('Y'); break; case 07: $label = 'Q3 ' . $pq3->format('Y'); break; case 10: $label = 'Q4 ' . $pq3->format('Y'); break; } var_dump($label); } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 61
Branch analysis from position: 61
2 jumps found. (Code = 44) Position 1 = 63, Position 2 = 9
Branch analysis from position: 63
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 60
Branch analysis from position: 12
2 jumps found. (Code = 44) Position 1 = 25, Position 2 = 32
Branch analysis from position: 25
2 jumps found. (Code = 44) Position 1 = 27, Position 2 = 38
Branch analysis from position: 27
2 jumps found. (Code = 44) Position 1 = 29, Position 2 = 44
Branch analysis from position: 29
2 jumps found. (Code = 44) Position 1 = 31, Position 2 = 50
Branch analysis from position: 31
1 jumps found. (Code = 42) Position 1 = 56
Branch analysis from position: 56
2 jumps found. (Code = 44) Position 1 = 63, Position 2 = 9
Branch analysis from position: 63
Branch analysis from position: 9
Branch analysis from position: 50
1 jumps found. (Code = 42) Position 1 = 56
Branch analysis from position: 56
Branch analysis from position: 44
1 jumps found. (Code = 42) Position 1 = 56
Branch analysis from position: 56
Branch analysis from position: 38
1 jumps found. (Code = 42) Position 1 = 56
Branch analysis from position: 56
Branch analysis from position: 32
1 jumps found. (Code = 42) Position 1 = 56
Branch analysis from position: 56
Branch analysis from position: 60
filename:       /in/9fslL
function name:  (null)
number of ops:  64
compiled vars:  !0 = $now, !1 = $months, !2 = $monthcnt, !3 = $label, !4 = $i, !5 = $minus, !6 = $pq3
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $7      'DateTimeImmutable'
          1        SEND_VAL_EX                                              'now'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $7
    4     4        ASSIGN                                                   !1, <array>
    5     5        ASSIGN                                                   !2, 0
    6     6        ASSIGN                                                   !3, ''
    7     7        ASSIGN                                                   !4, 1
          8      > JMP                                                      ->61
    8     9    >   MOD                                              ~14     !4, 3
         10        IS_EQUAL                                                 ~14, 0
         11      > JMPZ                                                     ~15, ->60
    9    12    >   ASSIGN_OP                                     1          !2, 3
   10    13        CONCAT                                           ~17     '-', !2
         14        CONCAT                                           ~18     ~17, '+months'
         15        ASSIGN                                                   !5, ~18
   11    16        INIT_METHOD_CALL                                         !0, 'modify'
         17        SEND_VAR_EX                                              !5
         18        DO_FCALL                                      0  $20     
         19        ASSIGN                                                   !6, $20
   13    20        INIT_METHOD_CALL                                         !6, 'format'
         21        SEND_VAL_EX                                              'm'
         22        DO_FCALL                                      0  $22     
   14    23        CASE                                                     $22, 1
         24      > JMPNZ                                                    ~23, ->32
   17    25    >   CASE                                                     $22, 4
         26      > JMPNZ                                                    ~23, ->38
   20    27    >   CASE                                                     $22, 7
         28      > JMPNZ                                                    ~23, ->44
   23    29    >   CASE                                                     $22, 10
         30      > JMPNZ                                                    ~23, ->50
         31    > > JMP                                                      ->56
   15    32    >   INIT_METHOD_CALL                                         !6, 'format'
         33        SEND_VAL_EX                                              'Y'
         34        DO_FCALL                                      0  $24     
         35        CONCAT                                           ~25     'Q1+', $24
         36        ASSIGN                                                   !3, ~25
   16    37      > JMP                                                      ->56
   18    38    >   INIT_METHOD_CALL                                         !6, 'format'
         39        SEND_VAL_EX                                              'Y'
         40        DO_FCALL                                      0  $27     
         41        CONCAT                                           ~28     'Q2+', $27
         42        ASSIGN                                                   !3, ~28
   19    43      > JMP                                                      ->56
   21    44    >   INIT_METHOD_CALL                                         !6, 'format'
         45        SEND_VAL_EX                                              'Y'
         46        DO_FCALL                                      0  $30     
         47        CONCAT                                           ~31     'Q3+', $30
         48        ASSIGN                                                   !3, ~31
   22    49      > JMP                                                      ->56
   24    50    >   INIT_METHOD_CALL                                         !6, 'format'
         51        SEND_VAL_EX                                              'Y'
         52        DO_FCALL                                      0  $33     
         53        CONCAT                                           ~34     'Q4+', $33
         54        ASSIGN                                                   !3, ~34
   25    55      > JMP                                                      ->56
         56    >   FREE                                                     $22
   27    57        INIT_FCALL                                               'var_dump'
         58        SEND_VAR                                                 !3
         59        DO_ICALL                                                 
    7    60    >   PRE_INC                                                  !4
         61    >   IS_SMALLER_OR_EQUAL                                      !4, 12
         62      > JMPNZ                                                    ~38, ->9
   29    63    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.1 ms | 1400 KiB | 15 Q