3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getMonths() { $monthsData = array(); $dateBegin = new \DateTime('2018-05-01'); $dateEnd = new \DateTime('2019-01-01'); while ($date->getTimestamp() < $dateEnd->getTimestamp()) { $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/UqcAb
function name:  (null)
number of ops:  7
compiled vars:  !0 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   INIT_FCALL                                               'getmonths'
          1        DO_FCALL                                      0  $1      
          2        ASSIGN                                                   !0, $1
   23     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 = 21
Branch analysis from position: 21
2 jumps found. (Code = 44) Position 1 = 27, Position 2 = 10
Branch analysis from position: 27
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
2 jumps found. (Code = 44) Position 1 = 27, Position 2 = 10
Branch analysis from position: 27
Branch analysis from position: 10
filename:       /in/UqcAb
function name:  getMonths
number of ops:  32
compiled vars:  !0 = $monthsData, !1 = $dateBegin, !2 = $dateEnd, !3 = $date
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   ASSIGN                                                   !0, <array>
    7     1        NEW                                              $5      'DateTime'
          2        SEND_VAL_EX                                              '2018-05-01'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !1, $5
    8     5        NEW                                              $8      'DateTime'
          6        SEND_VAL_EX                                              '2019-01-01'
          7        DO_FCALL                                      0          
          8        ASSIGN                                                   !2, $8
   10     9      > JMP                                                      ->21
   12    10    >   INIT_METHOD_CALL                                         !3, 'format'
         11        SEND_VAL_EX                                              'd%2Fm%2FY'
         12        DO_FCALL                                      0          
   13    13        ASSIGN_DIM                                               !0
         14        OP_DATA                                                  !3
   14    15        INIT_METHOD_CALL                                         !3, 'add'
         16        NEW                                              $13     'DateInterval'
         17        SEND_VAL_EX                                              'P1M'
         18        DO_FCALL                                      0          
         19        SEND_VAR_NO_REF_EX                                       $13
         20        DO_FCALL                                      0          
   10    21    >   INIT_METHOD_CALL                                         !3, 'getTimestamp'
         22        DO_FCALL                                      0  $16     
         23        INIT_METHOD_CALL                                         !2, 'getTimestamp'
         24        DO_FCALL                                      0  $17     
         25        IS_SMALLER                                               $16, $17
         26      > JMPNZ                                                    ~18, ->10
   17    27    >   INIT_FCALL                                               'ksort'
         28        SEND_REF                                                 !0
         29        DO_ICALL                                                 
   18    30      > RETURN                                                   !0
   19    31*     > RETURN                                                   null

End of function getmonths

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.02 ms | 1403 KiB | 18 Q