3v4l.org

run code in 300+ PHP versions simultaneously
<?php $t=date('Y'); $q = date('m'); for($e=$q;$e<=($q+2);$e++){ $ren = $t.'-'. sprintf("%'.02d", $e); var_dump($ren); } $begin = new DateTime( '2016-01-11' ); $numMonths = 3; for($i=0; $i<$numMonths; $i++) { var_dump($begin->modify( '+1 month' )->format("Y-m-d")); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
2 jumps found. (Code = 44) Position 1 = 24, Position 2 = 10
Branch analysis from position: 24
1 jumps found. (Code = 42) Position 1 = 41
Branch analysis from position: 41
2 jumps found. (Code = 44) Position 1 = 43, Position 2 = 31
Branch analysis from position: 43
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 31
2 jumps found. (Code = 44) Position 1 = 43, Position 2 = 31
Branch analysis from position: 43
Branch analysis from position: 31
Branch analysis from position: 10
2 jumps found. (Code = 44) Position 1 = 24, Position 2 = 10
Branch analysis from position: 24
Branch analysis from position: 10
filename:       /in/9nh7j
function name:  (null)
number of ops:  44
compiled vars:  !0 = $t, !1 = $q, !2 = $e, !3 = $ren, !4 = $begin, !5 = $numMonths, !6 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'date'
          1        SEND_VAL                                                 'Y'
          2        DO_ICALL                                         $7      
          3        ASSIGN                                                   !0, $7
    4     4        INIT_FCALL                                               'date'
          5        SEND_VAL                                                 'm'
          6        DO_ICALL                                         $9      
          7        ASSIGN                                                   !1, $9
    6     8        ASSIGN                                                   !2, !1
          9      > JMP                                                      ->21
    7    10    >   CONCAT                                           ~12     !0, '-'
         11        INIT_FCALL                                               'sprintf'
         12        SEND_VAL                                                 '%25%27.02d'
         13        SEND_VAR                                                 !2
         14        DO_ICALL                                         $13     
         15        CONCAT                                           ~14     ~12, $13
         16        ASSIGN                                                   !3, ~14
    8    17        INIT_FCALL                                               'var_dump'
         18        SEND_VAR                                                 !3
         19        DO_ICALL                                                 
    6    20        PRE_INC                                                  !2
         21    >   ADD                                              ~18     !1, 2
         22        IS_SMALLER_OR_EQUAL                                      !2, ~18
         23      > JMPNZ                                                    ~19, ->10
   11    24    >   NEW                                              $20     'DateTime'
         25        SEND_VAL_EX                                              '2016-01-11'
         26        DO_FCALL                                      0          
         27        ASSIGN                                                   !4, $20
   12    28        ASSIGN                                                   !5, 3
   13    29        ASSIGN                                                   !6, 0
         30      > JMP                                                      ->41
   15    31    >   INIT_FCALL                                               'var_dump'
         32        INIT_METHOD_CALL                                         !4, 'modify'
         33        SEND_VAL_EX                                              '%2B1+month'
         34        DO_FCALL                                      0  $25     
         35        INIT_METHOD_CALL                                         $25, 'format'
         36        SEND_VAL_EX                                              'Y-m-d'
         37        DO_FCALL                                      0  $26     
         38        SEND_VAR                                                 $26
         39        DO_ICALL                                                 
   13    40        PRE_INC                                                  !6
         41    >   IS_SMALLER                                               !6, !5
         42      > JMPNZ                                                    ~29, ->31
   16    43    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
174.25 ms | 1405 KiB | 19 Q