3v4l.org

run code in 300+ PHP versions simultaneously
<?php $mesi=array(); $start = new DateTime('2014-12-01'); $start->modify('first day of this month'); $end = new DateTime('2015-05-30'); $end->modify('first day of this month'); $interval = DateInterval::createFromDateString('1 month'); $period = new DatePeriod($start, $interval, $end); foreach ($period as $dt) { $mesi[]= $dt->format("mY") . PHP_EOL; } var_dump($mesi);die();
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 26, Position 2 = 34
Branch analysis from position: 26
2 jumps found. (Code = 78) Position 1 = 27, Position 2 = 34
Branch analysis from position: 27
1 jumps found. (Code = 42) Position 1 = 26
Branch analysis from position: 26
Branch analysis from position: 34
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 34
filename:       /in/D7uo1
function name:  (null)
number of ops:  40
compiled vars:  !0 = $mesi, !1 = $start, !2 = $end, !3 = $interval, !4 = $period, !5 = $dt
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    3     1        NEW                                              $7      'DateTime'
          2        SEND_VAL_EX                                              '2014-12-01'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !1, $7
    4     5        INIT_METHOD_CALL                                         !1, 'modify'
          6        SEND_VAL_EX                                              'first+day+of+this+month'
          7        DO_FCALL                                      0          
    5     8        NEW                                              $11     'DateTime'
          9        SEND_VAL_EX                                              '2015-05-30'
         10        DO_FCALL                                      0          
         11        ASSIGN                                                   !2, $11
    6    12        INIT_METHOD_CALL                                         !2, 'modify'
         13        SEND_VAL_EX                                              'first+day+of+this+month'
         14        DO_FCALL                                      0          
    7    15        INIT_STATIC_METHOD_CALL                                  'DateInterval', 'createFromDateString'
         16        SEND_VAL                                                 '1+month'
         17        DO_FCALL                                      0  $15     
         18        ASSIGN                                                   !3, $15
    8    19        NEW                                              $17     'DatePeriod'
         20        SEND_VAR_EX                                              !1
         21        SEND_VAR_EX                                              !3
         22        SEND_VAR_EX                                              !2
         23        DO_FCALL                                      0          
         24        ASSIGN                                                   !4, $17
   10    25      > FE_RESET_R                                       $20     !4, ->34
         26    > > FE_FETCH_R                                               $20, !5, ->34
   11    27    >   INIT_METHOD_CALL                                         !5, 'format'
         28        SEND_VAL_EX                                              'mY'
         29        DO_FCALL                                      0  $22     
         30        CONCAT                                           ~23     $22, '%0A'
         31        ASSIGN_DIM                                               !0
         32        OP_DATA                                                  ~23
   10    33      > JMP                                                      ->26
         34    >   FE_FREE                                                  $20
   13    35        INIT_FCALL                                               'var_dump'
         36        SEND_VAR                                                 !0
         37        DO_ICALL                                                 
         38      > EXIT                                                     
         39*     > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.03 ms | 1400 KiB | 15 Q