3v4l.org

run code in 300+ PHP versions simultaneously
<?php $d1=date_create('2009-12-25'); $i=DateInterval::createFromDateString('-1 year'); $p=new DatePeriod($d1,$i,5); foreach($p as $d) { echo $d->format('Y-m-d') . "\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 15, Position 2 = 22
Branch analysis from position: 15
2 jumps found. (Code = 78) Position 1 = 16, Position 2 = 22
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
filename:       /in/GSOpu
function name:  (null)
number of ops:  24
compiled vars:  !0 = $d1, !1 = $i, !2 = $p, !3 = $d
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'date_create'
          1        SEND_VAL                                                 '2009-12-25'
          2        DO_ICALL                                         $4      
          3        ASSIGN                                                   !0, $4
    4     4        INIT_STATIC_METHOD_CALL                                  'DateInterval', 'createFromDateString'
          5        SEND_VAL                                                 '-1+year'
          6        DO_FCALL                                      0  $6      
          7        ASSIGN                                                   !1, $6
    5     8        NEW                                              $8      'DatePeriod'
          9        SEND_VAR_EX                                              !0
         10        SEND_VAR_EX                                              !1
         11        SEND_VAL_EX                                              5
         12        DO_FCALL                                      0          
         13        ASSIGN                                                   !2, $8
    6    14      > FE_RESET_R                                       $11     !2, ->22
         15    > > FE_FETCH_R                                               $11, !3, ->22
    7    16    >   INIT_METHOD_CALL                                         !3, 'format'
         17        SEND_VAL_EX                                              'Y-m-d'
         18        DO_FCALL                                      0  $12     
         19        CONCAT                                           ~13     $12, '%0A'
         20        ECHO                                                     ~13
    6    21      > JMP                                                      ->15
         22    >   FE_FREE                                                  $11
    8    23      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
174.88 ms | 1400 KiB | 15 Q