3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.21 ms | 1392 KiB | 15 Q