3v4l.org

run code in 300+ PHP versions simultaneously
<?php $start = new DateTime('now'); $end = new DateTime('-1 year'); function getDates($start, $end) { $interval = new DateInterval('P1M'); $daterange = new DatePeriod($end,$interval,$start); $range = []; foreach($daterange as $date){ $range[] = $date->format("m-Y"); } return $range; } getDates($start,$end);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/boN6R
function name:  (null)
number of ops:  13
compiled vars:  !0 = $start, !1 = $end
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   NEW                                              $2      'DateTime'
          1        SEND_VAL_EX                                              'now'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $2
    3     4        NEW                                              $5      'DateTime'
          5        SEND_VAL_EX                                              '-1+year'
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !1, $5
   21     8        INIT_FCALL                                               'getdates'
          9        SEND_VAR                                                 !0
         10        SEND_VAR                                                 !1
         11        DO_FCALL                                      0          
         12      > RETURN                                                   1

Function getdates:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 14, Position 2 = 21
Branch analysis from position: 14
2 jumps found. (Code = 78) Position 1 = 15, Position 2 = 21
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
filename:       /in/boN6R
function name:  getDates
number of ops:  24
compiled vars:  !0 = $start, !1 = $end, !2 = $interval, !3 = $daterange, !4 = $range, !5 = $date
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    9     2        NEW                                              $6      'DateInterval'
          3        SEND_VAL_EX                                              'P1M'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !2, $6
   11     6        NEW                                              $9      'DatePeriod'
          7        SEND_VAR_EX                                              !1
          8        SEND_VAR_EX                                              !2
          9        SEND_VAR_EX                                              !0
         10        DO_FCALL                                      0          
         11        ASSIGN                                                   !3, $9
   13    12        ASSIGN                                                   !4, <array>
   14    13      > FE_RESET_R                                       $13     !3, ->21
         14    > > FE_FETCH_R                                               $13, !5, ->21
   15    15    >   INIT_METHOD_CALL                                         !5, 'format'
         16        SEND_VAL_EX                                              'm-Y'
         17        DO_FCALL                                      0  $15     
         18        ASSIGN_DIM                                               !4
         19        OP_DATA                                                  $15
   14    20      > JMP                                                      ->14
         21    >   FE_FREE                                                  $13
   18    22      > RETURN                                                   !4
   19    23*     > RETURN                                                   null

End of function getdates

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
175.96 ms | 1403 KiB | 14 Q