3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getMonths() { $monthsData = array(); $date = new \DateTime('2018-05-01'); while ($date < new \DateTime('2019-01-01')) { $date->format('d/m/Y'); $monthsData[] = $date; $date->add(new \DateInterval('P1M')); } ksort($monthsData); return $monthsData; } $data = getMonths(); var_dump($data);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gthAH
function name:  (null)
number of ops:  7
compiled vars:  !0 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   INIT_FCALL                                               'getmonths'
          1        DO_FCALL                                      0  $1      
          2        ASSIGN                                                   !0, $1
   22     3        INIT_FCALL                                               'var_dump'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                                 
          6      > RETURN                                                   1

Function getmonths:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
2 jumps found. (Code = 44) Position 1 = 22, Position 2 = 6
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 22, Position 2 = 6
Branch analysis from position: 22
Branch analysis from position: 6
filename:       /in/gthAH
function name:  getMonths
number of ops:  27
compiled vars:  !0 = $monthsData, !1 = $date
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   ASSIGN                                                   !0, <array>
    7     1        NEW                                              $3      'DateTime'
          2        SEND_VAL_EX                                              '2018-05-01'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !1, $3
    9     5      > JMP                                                      ->17
   11     6    >   INIT_METHOD_CALL                                         !1, 'format'
          7        SEND_VAL_EX                                              'd%2Fm%2FY'
          8        DO_FCALL                                      0          
   12     9        ASSIGN_DIM                                               !0
         10        OP_DATA                                                  !1
   13    11        INIT_METHOD_CALL                                         !1, 'add'
         12        NEW                                              $8      'DateInterval'
         13        SEND_VAL_EX                                              'P1M'
         14        DO_FCALL                                      0          
         15        SEND_VAR_NO_REF_EX                                       $8
         16        DO_FCALL                                      0          
    9    17    >   NEW                                              $11     'DateTime'
         18        SEND_VAL_EX                                              '2019-01-01'
         19        DO_FCALL                                      0          
         20        IS_SMALLER                                               !1, $11
         21      > JMPNZ                                                    ~13, ->6
   16    22    >   INIT_FCALL                                               'ksort'
         23        SEND_REF                                                 !0
         24        DO_ICALL                                                 
   17    25      > RETURN                                                   !0
   18    26*     > RETURN                                                   null

End of function getmonths

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.3 ms | 946 KiB | 19 Q