3v4l.org

run code in 300+ PHP versions simultaneously
<?php $dt = new DateTime('2019-01-31'); $day = $dt->format('d'); for ($i=1; $i <= 10; $i++) { $next = clone $dt; $next->add(new DateInterval("P{$i}M")); if ($next->format('d') != $day) continue; echo $next->format('Y-m-d') ."\n"; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 33
Branch analysis from position: 33
2 jumps found. (Code = 44) Position 1 = 35, Position 2 = 10
Branch analysis from position: 35
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 26, Position 2 = 27
Branch analysis from position: 26
1 jumps found. (Code = 42) Position 1 = 32
Branch analysis from position: 32
2 jumps found. (Code = 44) Position 1 = 35, Position 2 = 10
Branch analysis from position: 35
Branch analysis from position: 10
Branch analysis from position: 27
2 jumps found. (Code = 44) Position 1 = 35, Position 2 = 10
Branch analysis from position: 35
Branch analysis from position: 10
filename:       /in/oR5A3
function name:  (null)
number of ops:  36
compiled vars:  !0 = $dt, !1 = $day, !2 = $i, !3 = $next
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   NEW                                              $4      'DateTime'
          1        SEND_VAL_EX                                              '2019-01-31'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $4
    3     4        INIT_METHOD_CALL                                         !0, 'format'
          5        SEND_VAL_EX                                              'd'
          6        DO_FCALL                                      0  $7      
          7        ASSIGN                                                   !1, $7
    4     8        ASSIGN                                                   !2, 1
          9      > JMP                                                      ->33
    5    10    >   CLONE                                            ~10     !0
         11        ASSIGN                                                   !3, ~10
    6    12        INIT_METHOD_CALL                                         !3, 'add'
         13        NEW                                              $12     'DateInterval'
         14        ROPE_INIT                                     3  ~14     'P'
         15        ROPE_ADD                                      1  ~14     ~14, !2
         16        ROPE_END                                      2  ~13     ~14, 'M'
         17        SEND_VAL_EX                                              ~13
         18        DO_FCALL                                      0          
         19        SEND_VAR_NO_REF_EX                                       $12
         20        DO_FCALL                                      0          
    7    21        INIT_METHOD_CALL                                         !3, 'format'
         22        SEND_VAL_EX                                              'd'
         23        DO_FCALL                                      0  $18     
         24        IS_NOT_EQUAL                                             !1, $18
         25      > JMPZ                                                     ~19, ->27
         26    > > JMP                                                      ->32
    8    27    >   INIT_METHOD_CALL                                         !3, 'format'
         28        SEND_VAL_EX                                              'Y-m-d'
         29        DO_FCALL                                      0  $20     
         30        CONCAT                                           ~21     $20, '%0A'
         31        ECHO                                                     ~21
    4    32    >   PRE_INC                                                  !2
         33    >   IS_SMALLER_OR_EQUAL                                      !2, 10
         34      > JMPNZ                                                    ~23, ->10
    9    35    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
205.42 ms | 1008 KiB | 13 Q