3v4l.org

run code in 300+ PHP versions simultaneously
<?php $joinDate = '2014-04-22 10:36:33'; $today = date('Y-m-d H:i:s'); $Mdate1 = strtotime($joinDate); $Mdate2 = strtotime($today); $months = 0; while (strtotime('+1 MONTH', $Mdate1) < $Mdate2) { $months++; $Mdate1 = strtotime('+1 MONTH', $Mdate1); } echo $months; ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
2 jumps found. (Code = 44) Position 1 = 27, Position 2 = 15
Branch analysis from position: 27
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
2 jumps found. (Code = 44) Position 1 = 27, Position 2 = 15
Branch analysis from position: 27
Branch analysis from position: 15
filename:       /in/hg7VT
function name:  (null)
number of ops:  29
compiled vars:  !0 = $joinDate, !1 = $today, !2 = $Mdate1, !3 = $Mdate2, !4 = $months
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '2014-04-22+10%3A36%3A33'
    3     1        INIT_FCALL                                               'date'
          2        SEND_VAL                                                 'Y-m-d+H%3Ai%3As'
          3        DO_ICALL                                         $6      
          4        ASSIGN                                                   !1, $6
    4     5        INIT_FCALL                                               'strtotime'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                         $8      
          8        ASSIGN                                                   !2, $8
    5     9        INIT_FCALL                                               'strtotime'
         10        SEND_VAR                                                 !1
         11        DO_ICALL                                         $10     
         12        ASSIGN                                                   !3, $10
    6    13        ASSIGN                                                   !4, 0
    7    14      > JMP                                                      ->21
    8    15    >   PRE_INC                                                  !4
    9    16        INIT_FCALL                                               'strtotime'
         17        SEND_VAL                                                 '%2B1+MONTH'
         18        SEND_VAR                                                 !2
         19        DO_ICALL                                         $14     
         20        ASSIGN                                                   !2, $14
    7    21    >   INIT_FCALL                                               'strtotime'
         22        SEND_VAL                                                 '%2B1+MONTH'
         23        SEND_VAR                                                 !2
         24        DO_ICALL                                         $16     
         25        IS_SMALLER                                               $16, !3
         26      > JMPNZ                                                    ~17, ->15
   11    27    >   ECHO                                                     !4
   12    28      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.58 ms | 1396 KiB | 17 Q