3v4l.org

run code in 300+ PHP versions simultaneously
<?php function calcDays($startdate, $enddate) { $first = $startdate < $enddate ? $startdate : $enddate; $second = $startdate < $enddate ? $enddate : $startdate; $inbetween = $second - $first; $minute = 60; $hour = $minute * 60; $day = $hour * 24; $days = floor($inbetween / 60 / 60 / 24); $hours = floor($inbetween / 60 / 60 - $days / 60); $minutes = floor($inbetween / 60); return $days . " " . $hours . " " . $minutes; } echo calcDays(1388386746, 1388991546);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TJflJ
function name:  (null)
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   INIT_FCALL                                               'calcdays'
          1        SEND_VAL                                                 1388386746
          2        SEND_VAL                                                 1388991546
          3        DO_FCALL                                      0  $0      
          4        ECHO                                                     $0
          5      > RETURN                                                   1

Function calcdays:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 6
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 12
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 12
Branch analysis from position: 10
Branch analysis from position: 12
filename:       /in/TJflJ
function name:  calcDays
number of ops:  47
compiled vars:  !0 = $startdate, !1 = $enddate, !2 = $first, !3 = $second, !4 = $inbetween, !5 = $minute, !6 = $hour, !7 = $day, !8 = $days, !9 = $hours, !10 = $minutes
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    4     2        IS_SMALLER                                               !0, !1
          3      > JMPZ                                                     ~11, ->6
          4    >   QM_ASSIGN                                        ~12     !0
          5      > JMP                                                      ->7
          6    >   QM_ASSIGN                                        ~12     !1
          7    >   ASSIGN                                                   !2, ~12
    5     8        IS_SMALLER                                               !0, !1
          9      > JMPZ                                                     ~14, ->12
         10    >   QM_ASSIGN                                        ~15     !1
         11      > JMP                                                      ->13
         12    >   QM_ASSIGN                                        ~15     !0
         13    >   ASSIGN                                                   !3, ~15
    6    14        SUB                                              ~17     !3, !2
         15        ASSIGN                                                   !4, ~17
    8    16        ASSIGN                                                   !5, 60
    9    17        MUL                                              ~20     !5, 60
         18        ASSIGN                                                   !6, ~20
   10    19        MUL                                              ~22     !6, 24
         20        ASSIGN                                                   !7, ~22
   12    21        INIT_FCALL                                               'floor'
         22        DIV                                              ~24     !4, 60
         23        DIV                                              ~25     ~24, 60
         24        DIV                                              ~26     ~25, 24
         25        SEND_VAL                                                 ~26
         26        DO_ICALL                                         $27     
         27        ASSIGN                                                   !8, $27
   13    28        INIT_FCALL                                               'floor'
         29        DIV                                              ~29     !4, 60
         30        DIV                                              ~30     ~29, 60
         31        DIV                                              ~31     !8, 60
         32        SUB                                              ~32     ~30, ~31
         33        SEND_VAL                                                 ~32
         34        DO_ICALL                                         $33     
         35        ASSIGN                                                   !9, $33
   14    36        INIT_FCALL                                               'floor'
         37        DIV                                              ~35     !4, 60
         38        SEND_VAL                                                 ~35
         39        DO_ICALL                                         $36     
         40        ASSIGN                                                   !10, $36
   16    41        CONCAT                                           ~38     !8, '+'
         42        CONCAT                                           ~39     ~38, !9
         43        CONCAT                                           ~40     ~39, '+'
         44        CONCAT                                           ~41     ~40, !10
         45      > RETURN                                                   ~41
   17    46*     > RETURN                                                   null

End of function calcdays

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.07 ms | 1402 KiB | 16 Q