3v4l.org

run code in 300+ PHP versions simultaneously
<?php $dateFrom = new DateTime('01-02-2013'); $dateTo = new DateTime("01-03-2013"); $dateTo->modify("+1 month"); $date = $dateFrom; $result = array(); while ($dateFrom != $dateTo) { $result[] = $date->format("m-Y"); $date->modify('+1 month'); } print_r($result);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
2 jumps found. (Code = 44) Position 1 = 24, Position 2 = 14
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
2 jumps found. (Code = 44) Position 1 = 24, Position 2 = 14
Branch analysis from position: 24
Branch analysis from position: 14
filename:       /in/jMaS2
function name:  (null)
number of ops:  28
compiled vars:  !0 = $dateFrom, !1 = $dateTo, !2 = $date, !3 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   NEW                                              $4      'DateTime'
          1        SEND_VAL_EX                                              '01-02-2013'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $4
    3     4        NEW                                              $7      'DateTime'
          5        SEND_VAL_EX                                              '01-03-2013'
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !1, $7
    4     8        INIT_METHOD_CALL                                         !1, 'modify'
          9        SEND_VAL_EX                                              '%2B1+month'
         10        DO_FCALL                                      0          
    5    11        ASSIGN                                                   !2, !0
    6    12        ASSIGN                                                   !3, <array>
    8    13      > JMP                                                      ->22
    9    14    >   INIT_METHOD_CALL                                         !2, 'format'
         15        SEND_VAL_EX                                              'm-Y'
         16        DO_FCALL                                      0  $14     
         17        ASSIGN_DIM                                               !3
         18        OP_DATA                                                  $14
   10    19        INIT_METHOD_CALL                                         !2, 'modify'
         20        SEND_VAL_EX                                              '%2B1+month'
         21        DO_FCALL                                      0          
    8    22    >   IS_NOT_EQUAL                                             !0, !1
         23      > JMPNZ                                                    ~16, ->14
   12    24    >   INIT_FCALL                                               'print_r'
         25        SEND_VAR                                                 !3
         26        DO_ICALL                                                 
         27      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.46 ms | 1388 KiB | 15 Q