3v4l.org

run code in 300+ PHP versions simultaneously
<?php $dt = new DateTime('2019-01-31'); $day = $dt->format('d'); $i = 0; do { $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"; $i++; } while ($i < 10);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 23, Position 2 = 24
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 32
Branch analysis from position: 32
2 jumps found. (Code = 44) Position 1 = 34, Position 2 = 9
Branch analysis from position: 34
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
Branch analysis from position: 24
2 jumps found. (Code = 44) Position 1 = 34, Position 2 = 9
Branch analysis from position: 34
Branch analysis from position: 9
filename:       /in/SLOgi
function name:  (null)
number of ops:  35
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
    7     9    >   INIT_METHOD_CALL                                         !0, 'modify'
         10        SEND_VAL_EX                                              'first+day+of+this+month'
         11        DO_FCALL                                      0  $10     
         12        INIT_METHOD_CALL                                         $10, 'add'
         13        NEW                                              $11     'DateInterval'
         14        SEND_VAL_EX                                              'P1M'
         15        DO_FCALL                                      0          
         16        SEND_VAR_NO_REF_EX                                       $11
         17        DO_FCALL                                      0          
    8    18        INIT_METHOD_CALL                                         !0, 'format'
         19        SEND_VAL_EX                                              't'
         20        DO_FCALL                                      0  $14     
         21        IS_SMALLER                                               $14, !1
         22      > JMPZ                                                     ~15, ->24
    9    23    > > JMP                                                      ->32
   11    24    >   INIT_METHOD_CALL                                         !0, 'format'
         25        CONCAT                                           ~16     'Y-m-', !1
         26        SEND_VAL_EX                                              ~16
         27        DO_FCALL                                      0  $17     
         28        ASSIGN                                                   !3, $17
   12    29        CONCAT                                           ~19     !3, '%0A'
         30        ECHO                                                     ~19
   13    31        PRE_INC                                                  !2
   14    32    >   IS_SMALLER                                               !2, 10
         33      > JMPNZ                                                    ~21, ->9
         34    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
265 ms | 1008 KiB | 13 Q