3v4l.org

run code in 300+ PHP versions simultaneously
<?php $sdate = "2017-06-19"; $edate = "2017-08-21"; $ts1 = strtotime($sdate); $ts2 = strtotime($edate); $year1 = date('Y', $ts1); $year2 = date('Y', $ts2); $month1 = date('m', $ts1); $month2 = date('m', $ts2); $diff = (($year2 - $year1) * 12) + ($month2 - $month1); echo $diff; $Tickets = array($sdate); $time = strtotime($sdate); for($i=1; $i<=$diff; $i++) { $Tickets[] = date("Y-m-d", $time); $time = strtotime("+1 month", $time); //$sql = mysqli_query($con, "SUPPORT REQUEST QUERY"); } var_dump($Tickets);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 56
Branch analysis from position: 56
2 jumps found. (Code = 44) Position 1 = 58, Position 2 = 44
Branch analysis from position: 58
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 44
2 jumps found. (Code = 44) Position 1 = 58, Position 2 = 44
Branch analysis from position: 58
Branch analysis from position: 44
filename:       /in/hsvnF
function name:  (null)
number of ops:  62
compiled vars:  !0 = $sdate, !1 = $edate, !2 = $ts1, !3 = $ts2, !4 = $year1, !5 = $year2, !6 = $month1, !7 = $month2, !8 = $diff, !9 = $Tickets, !10 = $time, !11 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '2017-06-19'
    3     1        ASSIGN                                                   !1, '2017-08-21'
    5     2        INIT_FCALL                                               'strtotime'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $14     
          5        ASSIGN                                                   !2, $14
    6     6        INIT_FCALL                                               'strtotime'
          7        SEND_VAR                                                 !1
          8        DO_ICALL                                         $16     
          9        ASSIGN                                                   !3, $16
    7    10        INIT_FCALL                                               'date'
         11        SEND_VAL                                                 'Y'
         12        SEND_VAR                                                 !2
         13        DO_ICALL                                         $18     
         14        ASSIGN                                                   !4, $18
    8    15        INIT_FCALL                                               'date'
         16        SEND_VAL                                                 'Y'
         17        SEND_VAR                                                 !3
         18        DO_ICALL                                         $20     
         19        ASSIGN                                                   !5, $20
    9    20        INIT_FCALL                                               'date'
         21        SEND_VAL                                                 'm'
         22        SEND_VAR                                                 !2
         23        DO_ICALL                                         $22     
         24        ASSIGN                                                   !6, $22
   10    25        INIT_FCALL                                               'date'
         26        SEND_VAL                                                 'm'
         27        SEND_VAR                                                 !3
         28        DO_ICALL                                         $24     
         29        ASSIGN                                                   !7, $24
   12    30        SUB                                              ~26     !5, !4
         31        MUL                                              ~27     ~26, 12
         32        SUB                                              ~28     !7, !6
         33        ADD                                              ~29     ~27, ~28
         34        ASSIGN                                                   !8, ~29
   13    35        ECHO                                                     !8
   14    36        INIT_ARRAY                                       ~31     !0
         37        ASSIGN                                                   !9, ~31
   15    38        INIT_FCALL                                               'strtotime'
         39        SEND_VAR                                                 !0
         40        DO_ICALL                                         $33     
         41        ASSIGN                                                   !10, $33
   17    42        ASSIGN                                                   !11, 1
         43      > JMP                                                      ->56
   22    44    >   INIT_FCALL                                               'date'
         45        SEND_VAL                                                 'Y-m-d'
         46        SEND_VAR                                                 !10
         47        DO_ICALL                                         $37     
         48        ASSIGN_DIM                                               !9
         49        OP_DATA                                                  $37
   23    50        INIT_FCALL                                               'strtotime'
         51        SEND_VAL                                                 '%2B1+month'
         52        SEND_VAR                                                 !10
         53        DO_ICALL                                         $38     
         54        ASSIGN                                                   !10, $38
   17    55        PRE_INC                                                  !11
         56    >   IS_SMALLER_OR_EQUAL                                      !11, !8
         57      > JMPNZ                                                    ~41, ->44
   27    58    >   INIT_FCALL                                               'var_dump'
         59        SEND_VAR                                                 !9
         60        DO_ICALL                                                 
         61      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
170.61 ms | 1404 KiB | 19 Q