3v4l.org

run code in 500+ PHP versions simultaneously
<?php for ($i = 0; $i <= 12; $i++) { $start = date_parse("2015-01-30"); $target = mktime(0, 0, 0, $start["month"] + $i, $start["day"], $start["year"]); $tdate = getdate($target); if ($tdate["mday"] < $start["day"]) { $target = mktime(0, 0, 0, $start["month"] + $i + 1, 0, $start["year"]); } printf("+%02d = %s\n", $i, date("Y-m-d", $target)); }
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 = 52, Position 2 = 2
Branch analysis from position: 52
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 2
2 jumps found. (Code = 43) Position 1 = 27, Position 2 = 40
Branch analysis from position: 27
2 jumps found. (Code = 44) Position 1 = 52, Position 2 = 2
Branch analysis from position: 52
Branch analysis from position: 2
Branch analysis from position: 40
filename:       /in/Y3CHG
function name:  (null)
number of ops:  53
compiled vars:  !0 = $i, !1 = $start, !2 = $target, !3 = $tdate
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, 0
          1      > JMP                                                          ->50
    4     2    >   INIT_FCALL                                                   'date_parse'
          3        SEND_VAL                                                     '2015-01-30'
          4        DO_ICALL                                             $5      
          5        ASSIGN                                                       !1, $5
    5     6        INIT_FCALL                                                   'mktime'
          7        SEND_VAL                                                     0
          8        SEND_VAL                                                     0
          9        SEND_VAL                                                     0
         10        FETCH_DIM_R                                          ~7      !1, 'month'
         11        ADD                                                  ~8      ~7, !0
         12        SEND_VAL                                                     ~8
         13        FETCH_DIM_R                                          ~9      !1, 'day'
         14        SEND_VAL                                                     ~9
         15        FETCH_DIM_R                                          ~10     !1, 'year'
         16        SEND_VAL                                                     ~10
         17        DO_ICALL                                             $11     
         18        ASSIGN                                                       !2, $11
    7    19        INIT_FCALL                                                   'getdate'
         20        SEND_VAR                                                     !2
         21        DO_ICALL                                             $13     
         22        ASSIGN                                                       !3, $13
    8    23        FETCH_DIM_R                                          ~15     !3, 'mday'
         24        FETCH_DIM_R                                          ~16     !1, 'day'
         25        IS_SMALLER                                                   ~15, ~16
         26      > JMPZ                                                         ~17, ->40
    9    27    >   INIT_FCALL                                                   'mktime'
         28        SEND_VAL                                                     0
         29        SEND_VAL                                                     0
         30        SEND_VAL                                                     0
         31        FETCH_DIM_R                                          ~18     !1, 'month'
         32        ADD                                                  ~19     ~18, !0
         33        ADD                                                  ~20     ~19, 1
         34        SEND_VAL                                                     ~20
         35        SEND_VAL                                                     0
         36        FETCH_DIM_R                                          ~21     !1, 'year'
         37        SEND_VAL                                                     ~21
         38        DO_ICALL                                             $22     
         39        ASSIGN                                                       !2, $22
   12    40    >   INIT_FCALL                                                   'printf'
         41        SEND_VAL                                                     '%2B%2502d+%3D+%25s%0A'
         42        SEND_VAR                                                     !0
         43        INIT_FCALL                                                   'date'
         44        SEND_VAL                                                     'Y-m-d'
         45        SEND_VAR                                                     !2
         46        DO_ICALL                                             $24     
         47        SEND_VAR                                                     $24
         48        DO_ICALL                                                     
    3    49        PRE_INC                                                      !0
         50    >   IS_SMALLER_OR_EQUAL                                          !0, 12
         51      > JMPNZ                                                        ~27, ->2
   13    52    > > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
129.62 ms | 487 KiB | 12 Q