3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo date('m/Y', strtotime("20170501")); $a = "2007-01-01"; $b = "2008-02-15"; $i = date("Ym", strtotime($a)); while($i <= date("Ym", strtotime($b))){ echo $i."\n"; if(substr($i, 4, 2) == "12") $i = (date("Y", strtotime($i."01")) + 1)."01"; else $i++; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 41
Branch analysis from position: 41
2 jumps found. (Code = 44) Position 1 = 50, Position 2 = 19
Branch analysis from position: 50
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
2 jumps found. (Code = 43) Position 1 = 28, Position 2 = 40
Branch analysis from position: 28
1 jumps found. (Code = 42) Position 1 = 41
Branch analysis from position: 41
Branch analysis from position: 40
2 jumps found. (Code = 44) Position 1 = 50, Position 2 = 19
Branch analysis from position: 50
Branch analysis from position: 19
filename:       /in/mXGIb
function name:  (null)
number of ops:  51
compiled vars:  !0 = $a, !1 = $b, !2 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'date'
          1        SEND_VAL                                                 'm%2FY'
          2        INIT_FCALL                                               'strtotime'
          3        SEND_VAL                                                 '20170501'
          4        DO_ICALL                                         $3      
          5        SEND_VAR                                                 $3
          6        DO_ICALL                                         $4      
          7        ECHO                                                     $4
    5     8        ASSIGN                                                   !0, '2007-01-01'
    6     9        ASSIGN                                                   !1, '2008-02-15'
    8    10        INIT_FCALL                                               'date'
         11        SEND_VAL                                                 'Ym'
         12        INIT_FCALL                                               'strtotime'
         13        SEND_VAR                                                 !0
         14        DO_ICALL                                         $7      
         15        SEND_VAR                                                 $7
         16        DO_ICALL                                         $8      
         17        ASSIGN                                                   !2, $8
    9    18      > JMP                                                      ->41
   10    19    >   CONCAT                                           ~10     !2, '%0A'
         20        ECHO                                                     ~10
   11    21        INIT_FCALL                                               'substr'
         22        SEND_VAR                                                 !2
         23        SEND_VAL                                                 4
         24        SEND_VAL                                                 2
         25        DO_ICALL                                         $11     
         26        IS_EQUAL                                                 $11, '12'
         27      > JMPZ                                                     ~12, ->40
   12    28    >   INIT_FCALL                                               'date'
         29        SEND_VAL                                                 'Y'
         30        INIT_FCALL                                               'strtotime'
         31        CONCAT                                           ~13     !2, '01'
         32        SEND_VAL                                                 ~13
         33        DO_ICALL                                         $14     
         34        SEND_VAR                                                 $14
         35        DO_ICALL                                         $15     
         36        ADD                                              ~16     $15, 1
         37        CONCAT                                           ~17     ~16, '01'
         38        ASSIGN                                                   !2, ~17
         39      > JMP                                                      ->41
   14    40    >   PRE_INC                                                  !2
    9    41    >   INIT_FCALL                                               'date'
         42        SEND_VAL                                                 'Ym'
         43        INIT_FCALL                                               'strtotime'
         44        SEND_VAR                                                 !1
         45        DO_ICALL                                         $20     
         46        SEND_VAR                                                 $20
         47        DO_ICALL                                         $21     
         48        IS_SMALLER_OR_EQUAL                                      !2, $21
         49      > JMPNZ                                                    ~22, ->19
   15    50    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
195.64 ms | 1405 KiB | 19 Q