3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $dt_inicio = new DateTime(); $dt_inicio->setTimestamp(mktime(0,0,0, 6,20,2014)); $dt_fim = new DateTime(); $dt_fim->setTimestamp(mktime(0,0,0, 7,19,2015)); $interval = new DateInterval('P1M'); $diffAno = 2015 - 2014; $nmeses = (7 + ($diffAno * 12)) - 6; $period = new DatePeriod($dt_inicio, $interval, $nmeses); var_dump($period); foreach($period as $date){ $meses[] = array( "mes"=>$date->format('m'), "ano"=>$date->format('Y') ); } var_dump($meses);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 47, Position 2 = 59
Branch analysis from position: 47
2 jumps found. (Code = 78) Position 1 = 48, Position 2 = 59
Branch analysis from position: 48
1 jumps found. (Code = 42) Position 1 = 47
Branch analysis from position: 47
Branch analysis from position: 59
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 59
filename:       /in/IAIJZ
function name:  (null)
number of ops:  64
compiled vars:  !0 = $dt_inicio, !1 = $dt_fim, !2 = $interval, !3 = $diffAno, !4 = $nmeses, !5 = $period, !6 = $date, !7 = $meses
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   3     0  E >   NEW                                              $8      :-5
         1        DO_FCALL                                      0          
         2        ASSIGN                                                   !0, $8
   4     3        INIT_METHOD_CALL                                         !0, 'setTimestamp'
         4        INIT_FCALL                                               'mktime'
         5        SEND_VAL                                                 0
         6        SEND_VAL                                                 0
         7        SEND_VAL                                                 0
         8        SEND_VAL                                                 6
         9        SEND_VAL                                                 20
        10        SEND_VAL                                                 2014
        11        DO_ICALL                                         $11     
        12        SEND_VAR_NO_REF_EX                                       $11
        13        DO_FCALL                                      0          
   6    14        NEW                                              $13     :6
        15        DO_FCALL                                      0          
        16        ASSIGN                                                   !1, $13
   7    17        INIT_METHOD_CALL                                         !1, 'setTimestamp'
        18        INIT_FCALL                                               'mktime'
        19        SEND_VAL                                                 0
        20        SEND_VAL                                                 0
        21        SEND_VAL                                                 0
        22        SEND_VAL                                                 7
        23        SEND_VAL                                                 19
        24        SEND_VAL                                                 2015
        25        DO_ICALL                                         $16     
        26        SEND_VAR_NO_REF_EX                                       $16
        27        DO_FCALL                                      0          
   9    28        NEW                                              $18     :17
        29        SEND_VAL_EX                                              'P1M'
        30        DO_FCALL                                      0          
        31        ASSIGN                                                   !2, $18
  11    32        ASSIGN                                                   !3, 1
  12    33        MUL                                              ~22     !3, 12
        34        ADD                                              ~23     7, ~22
        35        SUB                                              ~24     ~23, 6
        36        ASSIGN                                                   !4, ~24
  13    37        NEW                                              $26     :24
        38        SEND_VAR_EX                                              !0
        39        SEND_VAR_EX                                              !2
        40        SEND_VAR_EX                                              !4
        41        DO_FCALL                                      0          
        42        ASSIGN                                                   !5, $26
  15    43        INIT_FCALL                                               'var_dump'
        44        SEND_VAR                                                 !5
        45        DO_ICALL                                                 
  17    46      > FE_RESET_R                                       $30     !5, ->59
        47    > > FE_FETCH_R                                               $30, !6, ->59
  19    48    >   INIT_METHOD_CALL                                         !6, 'format'
        49        SEND_VAL_EX                                              'm'
        50        DO_FCALL                                      0  $32     
        51        INIT_ARRAY                                       ~33     $32, 'mes'
  20    52        INIT_METHOD_CALL                                         !6, 'format'
        53        SEND_VAL_EX                                              'Y'
        54        DO_FCALL                                      0  $34     
        55        ADD_ARRAY_ELEMENT                                ~33     $34, 'ano'
  18    56        ASSIGN_DIM                                               !7
  20    57        OP_DATA                                                  ~33
        58      > JMP                                                      ->47
        59    >   FE_FREE                                                  $30
  23    60        INIT_FCALL                                               'var_dump'
        61        SEND_VAR                                                 !7
        62        DO_ICALL                                                 
        63      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 7.3.0