3v4l.org

run code in 300+ PHP versions simultaneously
<?php $dt1 = getdate(); $dt2 = getdate(); $date1 = date_create("".$dt1.""); $date2 = date_create("".$dt2.""); $dateDiff = date_diff($date2, $date1); $probDays = $dateDiff->days; $probMon = $dateDiff->m; $probYear = $dateDiff->y; $month = $probDays / 30; $totLeave = $month * 1; if($month > $probmon) { $totLeave = $totLeave + 1; } ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 35, Position 2 = 37
Branch analysis from position: 35
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 37
filename:       /in/V9KXV
function name:  (null)
number of ops:  38
compiled vars:  !0 = $dt1, !1 = $dt2, !2 = $date1, !3 = $date2, !4 = $dateDiff, !5 = $probDays, !6 = $probMon, !7 = $probYear, !8 = $month, !9 = $totLeave, !10 = $probmon
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'getdate'
          1        DO_ICALL                                         $11     
          2        ASSIGN                                                   !0, $11
    3     3        INIT_FCALL                                               'getdate'
          4        DO_ICALL                                         $13     
          5        ASSIGN                                                   !1, $13
    5     6        INIT_FCALL                                               'date_create'
          7        CONCAT                                           ~15     '', !0
          8        CONCAT                                           ~16     ~15, ''
          9        SEND_VAL                                                 ~16
         10        DO_ICALL                                         $17     
         11        ASSIGN                                                   !2, $17
    7    12        INIT_FCALL                                               'date_create'
         13        CONCAT                                           ~19     '', !1
         14        CONCAT                                           ~20     ~19, ''
         15        SEND_VAL                                                 ~20
         16        DO_ICALL                                         $21     
         17        ASSIGN                                                   !3, $21
    9    18        INIT_FCALL                                               'date_diff'
         19        SEND_VAR                                                 !3
         20        SEND_VAR                                                 !2
         21        DO_ICALL                                         $23     
         22        ASSIGN                                                   !4, $23
   11    23        FETCH_OBJ_R                                      ~25     !4, 'days'
         24        ASSIGN                                                   !5, ~25
   12    25        FETCH_OBJ_R                                      ~27     !4, 'm'
         26        ASSIGN                                                   !6, ~27
   13    27        FETCH_OBJ_R                                      ~29     !4, 'y'
         28        ASSIGN                                                   !7, ~29
   15    29        DIV                                              ~31     !5, 30
         30        ASSIGN                                                   !8, ~31
   16    31        MUL                                              ~33     !8, 1
         32        ASSIGN                                                   !9, ~33
   18    33        IS_SMALLER                                               !10, !8
         34      > JMPZ                                                     ~35, ->37
   20    35    >   ADD                                              ~36     !9, 1
         36        ASSIGN                                                   !9, ~36
   22    37    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.6 ms | 1396 KiB | 19 Q