3v4l.org

run code in 300+ PHP versions simultaneously
<?php $dt = new \DateTime('2014-01-31'); $dp = new \DatePeriod($dt, new \DateInterval('P1M'), 1); foreach ($dp as $period) { echo $period->format('Y-m-d'); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 14, Position 2 = 20
Branch analysis from position: 14
2 jumps found. (Code = 78) Position 1 = 15, Position 2 = 20
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
filename:       /in/k2GNF
function name:  (null)
number of ops:  22
compiled vars:  !0 = $dt, !1 = $dp, !2 = $period
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   NEW                                              $3      'DateTime'
          1        SEND_VAL_EX                                              '2014-01-31'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $3
    3     4        NEW                                              $6      'DatePeriod'
          5        SEND_VAR_EX                                              !0
          6        NEW                                              $7      'DateInterval'
          7        SEND_VAL_EX                                              'P1M'
          8        DO_FCALL                                      0          
          9        SEND_VAR_NO_REF_EX                                       $7
         10        SEND_VAL_EX                                              1
         11        DO_FCALL                                      0          
         12        ASSIGN                                                   !1, $6
    4    13      > FE_RESET_R                                       $11     !1, ->20
         14    > > FE_FETCH_R                                               $11, !2, ->20
    5    15    >   INIT_METHOD_CALL                                         !2, 'format'
         16        SEND_VAL_EX                                              'Y-m-d'
         17        DO_FCALL                                      0  $12     
         18        ECHO                                                     $12
    4    19      > JMP                                                      ->14
         20    >   FE_FREE                                                  $11
    6    21      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.31 ms | 1393 KiB | 13 Q