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 / $day); $hours = floor($inbetween / $hour - $days * $hour); $minutes = floor($inbetween / $minute - $hours * $hour - $days * $day); return $days . " " . $hours . " " . $minutes; } echo calcDays(1388385927, 1488390027);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4EhBh
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                                                 1388385927
          2        SEND_VAL                                                 1488390027
          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/4EhBh
function name:  calcDays
number of ops:  48
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, !7
         23        SEND_VAL                                                 ~24
         24        DO_ICALL                                         $25     
         25        ASSIGN                                                   !8, $25
   13    26        INIT_FCALL                                               'floor'
         27        DIV                                              ~27     !4, !6
         28        MUL                                              ~28     !8, !6
         29        SUB                                              ~29     ~27, ~28
         30        SEND_VAL                                                 ~29
         31        DO_ICALL                                         $30     
         32        ASSIGN                                                   !9, $30
   14    33        INIT_FCALL                                               'floor'
         34        DIV                                              ~32     !4, !5
         35        MUL                                              ~33     !9, !6
         36        SUB                                              ~34     ~32, ~33
         37        MUL                                              ~35     !8, !7
         38        SUB                                              ~36     ~34, ~35
         39        SEND_VAL                                                 ~36
         40        DO_ICALL                                         $37     
         41        ASSIGN                                                   !10, $37
   16    42        CONCAT                                           ~39     !8, '+'
         43        CONCAT                                           ~40     ~39, !9
         44        CONCAT                                           ~41     ~40, '+'
         45        CONCAT                                           ~42     ~41, !10
         46      > RETURN                                                   ~42
   17    47*     > RETURN                                                   null

End of function calcdays

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
175.11 ms | 1402 KiB | 16 Q