3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = "2007-01-01"; $b = "2008-02-15"; $i = date("y-m", strtotime($a)); $y = date("y-m", strtotime($b)); while($i <= date("y-m", strtotime($b))){ echo $i."\n"; if(substr($i, 3, 2) == "12") $i = (date('y', mktime(0,0,0,1,1,substr($i,0,2)))+1)."-01"; else $i++; } echo date('y', mktime(0,0,0,1,1,substr($i,0,2)))+1; // echo "Oct 3,1975 was on a ".date("y", mktime(0,0,0,10,3,7)) . "<br>";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 50
Branch analysis from position: 50
2 jumps found. (Code = 44) Position 1 = 59, Position 2 = 19
Branch analysis from position: 59
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
2 jumps found. (Code = 43) Position 1 = 28, Position 2 = 49
Branch analysis from position: 28
1 jumps found. (Code = 42) Position 1 = 50
Branch analysis from position: 50
Branch analysis from position: 49
2 jumps found. (Code = 44) Position 1 = 59, Position 2 = 19
Branch analysis from position: 59
Branch analysis from position: 19
filename:       /in/sCpr7
function name:  (null)
number of ops:  79
compiled vars:  !0 = $a, !1 = $b, !2 = $i, !3 = $y
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '2007-01-01'
    4     1        ASSIGN                                                   !1, '2008-02-15'
    6     2        INIT_FCALL                                               'date'
          3        SEND_VAL                                                 'y-m'
          4        INIT_FCALL                                               'strtotime'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $6      
          7        SEND_VAR                                                 $6
          8        DO_ICALL                                         $7      
          9        ASSIGN                                                   !2, $7
    7    10        INIT_FCALL                                               'date'
         11        SEND_VAL                                                 'y-m'
         12        INIT_FCALL                                               'strtotime'
         13        SEND_VAR                                                 !1
         14        DO_ICALL                                         $9      
         15        SEND_VAR                                                 $9
         16        DO_ICALL                                         $10     
         17        ASSIGN                                                   !3, $10
    8    18      > JMP                                                      ->50
    9    19    >   CONCAT                                           ~12     !2, '%0A'
         20        ECHO                                                     ~12
   10    21        INIT_FCALL                                               'substr'
         22        SEND_VAR                                                 !2
         23        SEND_VAL                                                 3
         24        SEND_VAL                                                 2
         25        DO_ICALL                                         $13     
         26        IS_EQUAL                                                 $13, '12'
         27      > JMPZ                                                     ~14, ->49
   11    28    >   INIT_FCALL                                               'date'
         29        SEND_VAL                                                 'y'
         30        INIT_FCALL                                               'mktime'
         31        SEND_VAL                                                 0
         32        SEND_VAL                                                 0
         33        SEND_VAL                                                 0
         34        SEND_VAL                                                 1
         35        SEND_VAL                                                 1
         36        INIT_FCALL                                               'substr'
         37        SEND_VAR                                                 !2
         38        SEND_VAL                                                 0
         39        SEND_VAL                                                 2
         40        DO_ICALL                                         $15     
         41        SEND_VAR                                                 $15
         42        DO_ICALL                                         $16     
         43        SEND_VAR                                                 $16
         44        DO_ICALL                                         $17     
         45        ADD                                              ~18     $17, 1
         46        CONCAT                                           ~19     ~18, '-01'
         47        ASSIGN                                                   !2, ~19
   10    48      > JMP                                                      ->50
   13    49    >   PRE_INC                                                  !2
    8    50    >   INIT_FCALL                                               'date'
         51        SEND_VAL                                                 'y-m'
         52        INIT_FCALL                                               'strtotime'
         53        SEND_VAR                                                 !1
         54        DO_ICALL                                         $22     
         55        SEND_VAR                                                 $22
         56        DO_ICALL                                         $23     
         57        IS_SMALLER_OR_EQUAL                                      !2, $23
         58      > JMPNZ                                                    ~24, ->19
   15    59    >   INIT_FCALL                                               'date'
         60        SEND_VAL                                                 'y'
         61        INIT_FCALL                                               'mktime'
         62        SEND_VAL                                                 0
         63        SEND_VAL                                                 0
         64        SEND_VAL                                                 0
         65        SEND_VAL                                                 1
         66        SEND_VAL                                                 1
         67        INIT_FCALL                                               'substr'
         68        SEND_VAR                                                 !2
         69        SEND_VAL                                                 0
         70        SEND_VAL                                                 2
         71        DO_ICALL                                         $25     
         72        SEND_VAR                                                 $25
         73        DO_ICALL                                         $26     
         74        SEND_VAR                                                 $26
         75        DO_ICALL                                         $27     
         76        ADD                                              ~28     $27, 1
         77        ECHO                                                     ~28
   17    78      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.77 ms | 1018 KiB | 17 Q