3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
140.99 ms | 1401 KiB | 17 Q