3v4l.org

run code in 300+ PHP versions simultaneously
<?php $start = new DateTimeImmutable('2012-07-01'); $interval = new DateInterval('P1D'); $periodWithRecurrences = new \DatePeriod($start, $interval, $start->add($interval)); foreach($periodWithRecurrences as $date) { echo $date->format('Y-m-d') . \PHP_EOL; } echo \PHP_EOL; $periodWithRecurrences = new DatePeriod($start, $interval, 0); foreach($periodWithRecurrences as $date) { echo $date->format('Y-m-d') . \PHP_EOL; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 18, Position 2 = 25
Branch analysis from position: 18
2 jumps found. (Code = 78) Position 1 = 19, Position 2 = 25
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
Branch analysis from position: 25
2 jumps found. (Code = 77) Position 1 = 34, Position 2 = 41
Branch analysis from position: 34
2 jumps found. (Code = 78) Position 1 = 35, Position 2 = 41
Branch analysis from position: 35
1 jumps found. (Code = 42) Position 1 = 34
Branch analysis from position: 34
Branch analysis from position: 41
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 41
Branch analysis from position: 25
filename:       /in/ReWbN
function name:  (null)
number of ops:  43
compiled vars:  !0 = $start, !1 = $interval, !2 = $periodWithRecurrences, !3 = $date
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $4      'DateTimeImmutable'
          1        SEND_VAL_EX                                              '2012-07-01'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $4
    4     4        NEW                                              $7      'DateInterval'
          5        SEND_VAL_EX                                              'P1D'
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !1, $7
    6     8        NEW                                              $10     'DatePeriod'
          9        SEND_VAR_EX                                              !0
         10        SEND_VAR_EX                                              !1
         11        INIT_METHOD_CALL                                         !0, 'add'
         12        SEND_VAR_EX                                              !1
         13        DO_FCALL                                      0  $11     
         14        SEND_VAR_NO_REF_EX                                       $11
         15        DO_FCALL                                      0          
         16        ASSIGN                                                   !2, $10
    7    17      > FE_RESET_R                                       $14     !2, ->25
         18    > > FE_FETCH_R                                               $14, !3, ->25
    8    19    >   INIT_METHOD_CALL                                         !3, 'format'
         20        SEND_VAL_EX                                              'Y-m-d'
         21        DO_FCALL                                      0  $15     
         22        CONCAT                                           ~16     $15, '%0A'
         23        ECHO                                                     ~16
    7    24      > JMP                                                      ->18
         25    >   FE_FREE                                                  $14
   11    26        ECHO                                                     '%0A'
   13    27        NEW                                              $17     'DatePeriod'
         28        SEND_VAR_EX                                              !0
         29        SEND_VAR_EX                                              !1
         30        SEND_VAL_EX                                              0
         31        DO_FCALL                                      0          
         32        ASSIGN                                                   !2, $17
   14    33      > FE_RESET_R                                       $20     !2, ->41
         34    > > FE_FETCH_R                                               $20, !3, ->41
   15    35    >   INIT_METHOD_CALL                                         !3, 'format'
         36        SEND_VAL_EX                                              'Y-m-d'
         37        DO_FCALL                                      0  $21     
         38        CONCAT                                           ~22     $21, '%0A'
         39        ECHO                                                     ~22
   14    40      > JMP                                                      ->34
         41    >   FE_FREE                                                  $20
   16    42      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.02 ms | 1403 KiB | 13 Q