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->getTimestamp()); 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 = 26
Branch analysis from position: 26
2 jumps found. (Code = 44) Position 1 = 32, Position 2 = 15
Branch analysis from position: 32
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
2 jumps found. (Code = 44) Position 1 = 32, Position 2 = 15
Branch analysis from position: 32
Branch analysis from position: 15
filename:       /in/fsN7Z
function name:  (null)
number of ops:  37
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        INIT_METHOD_CALL                                         !1, 'getTimestamp'
         11        DO_FCALL                                      0  $10     
         12        SEND_VAR                                                 $10
         13        DO_ICALL                                                 
   10    14      > JMP                                                      ->26
   12    15    >   INIT_METHOD_CALL                                         !1, 'format'
         16        SEND_VAL_EX                                              'm%2FY'
         17        DO_FCALL                                      0          
   13    18        ASSIGN_DIM                                               !0
         19        OP_DATA                                                  !1
   14    20        INIT_METHOD_CALL                                         !1, 'add'
         21        NEW                                              $14     'DateInterval'
         22        SEND_VAL_EX                                              'P1M'
         23        DO_FCALL                                      0          
         24        SEND_VAR_NO_REF_EX                                       $14
         25        DO_FCALL                                      0          
   10    26    >   INIT_METHOD_CALL                                         !1, 'getTimestamp'
         27        DO_FCALL                                      0  $17     
         28        INIT_METHOD_CALL                                         !2, 'getTimestamp'
         29        DO_FCALL                                      0  $18     
         30        IS_SMALLER                                               $17, $18
         31      > JMPNZ                                                    ~19, ->15
   19    32    >   INIT_FCALL                                               'ksort'
         33        SEND_REF                                                 !0
         34        DO_ICALL                                                 
   20    35      > RETURN                                                   !0
   21    36*     > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
172.21 ms | 1396 KiB | 17 Q