3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.02 ms | 1400 KiB | 15 Q