3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
218.29 ms | 1008 KiB | 13 Q