3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getDates() { $start = new DateTime('now'); $end = new DateTime('-1 year'); $interval = new DateInterval('P1M'); $daterange = new DatePeriod($end,$interval,$start); $range = []; foreach($daterange as $date){ $range[] = $date->format("m-Y"); } return $range; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/M87gM
function name:  (null)
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E > > RETURN                                                   1

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

End of function getdates

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
172.12 ms | 1395 KiB | 13 Q