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; for($i=1; $i<=$diff; $i++) { $time = strtotime($sdate); $final = date("Y-m-d", strtotime("+1 month", $time)); echo $final ."\n"; //$sql = mysqli_query($con, "SUPPORT REQUEST QUERY"); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 54
Branch analysis from position: 54
2 jumps found. (Code = 44) Position 1 = 56, Position 2 = 38
Branch analysis from position: 56
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 38
2 jumps found. (Code = 44) Position 1 = 56, Position 2 = 38
Branch analysis from position: 56
Branch analysis from position: 38
filename:       /in/Y7kIG
function name:  (null)
number of ops:  57
compiled vars:  !0 = $sdate, !1 = $edate, !2 = $ts1, !3 = $ts2, !4 = $year1, !5 = $year2, !6 = $month1, !7 = $month2, !8 = $diff, !9 = $i, !10 = $time, !11 = $final
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        ASSIGN                                                   !9, 1
         37      > JMP                                                      ->54
   18    38    >   INIT_FCALL                                               'strtotime'
         39        SEND_VAR                                                 !0
         40        DO_ICALL                                         $32     
         41        ASSIGN                                                   !10, $32
   19    42        INIT_FCALL                                               'date'
         43        SEND_VAL                                                 'Y-m-d'
         44        INIT_FCALL                                               'strtotime'
         45        SEND_VAL                                                 '%2B1+month'
         46        SEND_VAR                                                 !10
         47        DO_ICALL                                         $34     
         48        SEND_VAR                                                 $34
         49        DO_ICALL                                         $35     
         50        ASSIGN                                                   !11, $35
   20    51        CONCAT                                           ~37     !11, '%0A'
         52        ECHO                                                     ~37
   14    53        PRE_INC                                                  !9
         54    >   IS_SMALLER_OR_EQUAL                                      !9, !8
         55      > JMPNZ                                                    ~39, ->38
   22    56    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.7 ms | 1400 KiB | 17 Q