3v4l.org

run code in 500+ PHP versions simultaneously
<?php $oneMonth = new \DateInterval('P1M'); $startDate = \DateTime::createFromFormat('d H:i:s', '1 00:00:00')->sub(new \DateInterval('P4M')); $period = new \DatePeriod($startDate, $oneMonth, 16); foreach($period as $date){ //$date is an instance of \DateTime. I'm just var_dumping it for illustration var_dump($date); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 22, Position 2 = 27
Branch analysis from position: 22
2 jumps found. (Code = 78) Position 1 = 23, Position 2 = 27
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
Branch analysis from position: 27
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 27
filename:       /in/9HbHY
function name:  (null)
number of ops:  29
compiled vars:  !0 = $oneMonth, !1 = $startDate, !2 = $period, !3 = $date
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   NEW                                                  $4      'DateInterval'
          1        SEND_VAL_EX                                                  'P1M'
          2        DO_FCALL                                          0          
          3        ASSIGN                                                       !0, $4
    3     4        INIT_STATIC_METHOD_CALL                                      'DateTime', 'createFromFormat'
          5        SEND_VAL                                                     'd+H%3Ai%3As'
          6        SEND_VAL                                                     '1+00%3A00%3A00'
          7        DO_FCALL                                          0  $7      
          8        INIT_METHOD_CALL                                             $7, 'sub'
          9        NEW                                                  $8      'DateInterval'
         10        SEND_VAL_EX                                                  'P4M'
         11        DO_FCALL                                          0          
         12        SEND_VAR_NO_REF_EX                                           $8
         13        DO_FCALL                                          0  $10     
         14        ASSIGN                                                       !1, $10
    4    15        NEW                                                  $12     'DatePeriod'
         16        SEND_VAR_EX                                                  !1
         17        SEND_VAR_EX                                                  !0
         18        SEND_VAL_EX                                                  16
         19        DO_FCALL                                          0          
         20        ASSIGN                                                       !2, $12
    6    21      > FE_RESET_R                                           $15     !2, ->27
         22    > > FE_FETCH_R                                                   $15, !3, ->27
    8    23    >   INIT_FCALL                                                   'var_dump'
         24        SEND_VAR                                                     !3
         25        DO_ICALL                                                     
    6    26      > JMP                                                          ->22
         27    >   FE_FREE                                                      $15
    9    28      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
177.22 ms | 4537 KiB | 14 Q