3v4l.org

run code in 300+ PHP versions simultaneously
<?php $start = new \DateTime('yesterday'); $now = new \DateTime(); $end = new \DateTime('+ 6 month'); $interval = new \DateInterval('P1M'); if($now >= $start){ $period = new \DatePeriod($start, $interval, $end); foreach($period as $date){ var_dump($date); } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 30
Branch analysis from position: 17
2 jumps found. (Code = 77) Position 1 = 24, Position 2 = 29
Branch analysis from position: 24
2 jumps found. (Code = 78) Position 1 = 25, Position 2 = 29
Branch analysis from position: 25
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
Branch analysis from position: 29
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 29
Branch analysis from position: 30
filename:       /in/r6Vfv
function name:  (null)
number of ops:  31
compiled vars:  !0 = $start, !1 = $now, !2 = $end, !3 = $interval, !4 = $period, !5 = $date
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   NEW                                              $6      'DateTime'
          1        SEND_VAL_EX                                              'yesterday'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $6
    3     4        NEW                                              $9      'DateTime'
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !1, $9
    4     7        NEW                                              $12     'DateTime'
          8        SEND_VAL_EX                                              '%2B+6+month'
          9        DO_FCALL                                      0          
         10        ASSIGN                                                   !2, $12
    5    11        NEW                                              $15     'DateInterval'
         12        SEND_VAL_EX                                              'P1M'
         13        DO_FCALL                                      0          
         14        ASSIGN                                                   !3, $15
    7    15        IS_SMALLER_OR_EQUAL                                      !0, !1
         16      > JMPZ                                                     ~18, ->30
    8    17    >   NEW                                              $19     'DatePeriod'
         18        SEND_VAR_EX                                              !0
         19        SEND_VAR_EX                                              !3
         20        SEND_VAR_EX                                              !2
         21        DO_FCALL                                      0          
         22        ASSIGN                                                   !4, $19
    9    23      > FE_RESET_R                                       $22     !4, ->29
         24    > > FE_FETCH_R                                               $22, !5, ->29
   10    25    >   INIT_FCALL                                               'var_dump'
         26        SEND_VAR                                                 !5
         27        DO_ICALL                                                 
    9    28      > JMP                                                      ->24
         29    >   FE_FREE                                                  $22
   12    30    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.11 ms | 1388 KiB | 15 Q