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); $minutes = floor($inbetween / $minute - $hours * $minute - $days * $hour); 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/fOasl
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/fOasl
function name:  calcDays
number of ops:  49
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        DIV                                              ~20     !5, 60
         18        ASSIGN                                                   !6, ~20
   10    19        DIV                                              ~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        SEND_VAL                                                 ~30
         32        DO_ICALL                                         $31     
         33        ASSIGN                                                   !9, $31
   14    34        INIT_FCALL                                               'floor'
         35        DIV                                              ~33     !4, !5
         36        MUL                                              ~34     !9, !5
         37        SUB                                              ~35     ~33, ~34
         38        MUL                                              ~36     !8, !6
         39        SUB                                              ~37     ~35, ~36
         40        SEND_VAL                                                 ~37
         41        DO_ICALL                                         $38     
         42        ASSIGN                                                   !10, $38
   16    43        CONCAT                                           ~40     !8, '+'
         44        CONCAT                                           ~41     ~40, !9
         45        CONCAT                                           ~42     ~41, '+'
         46        CONCAT                                           ~43     ~42, !10
         47      > RETURN                                                   ~43
   17    48*     > RETURN                                                   null

End of function calcdays

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.16 ms | 1402 KiB | 16 Q