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; $days = floor($inbetween / 60 / 60 / 24); $hours = floor($inbetween / 60 / 60 - $days * 24); $minutes = floor($inbetween / 60 - $hours * 60); 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/99VJr
function name:  (null)
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     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/99VJr
function name:  calcDays
number of ops:  44
compiled vars:  !0 = $startdate, !1 = $enddate, !2 = $first, !3 = $second, !4 = $inbetween, !5 = $days, !6 = $hours, !7 = $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                                                     ~8, ->6
          4    >   QM_ASSIGN                                        ~9      !0
          5      > JMP                                                      ->7
          6    >   QM_ASSIGN                                        ~9      !1
          7    >   ASSIGN                                                   !2, ~9
    5     8        IS_SMALLER                                               !0, !1
          9      > JMPZ                                                     ~11, ->12
         10    >   QM_ASSIGN                                        ~12     !1
         11      > JMP                                                      ->13
         12    >   QM_ASSIGN                                        ~12     !0
         13    >   ASSIGN                                                   !3, ~12
    6    14        SUB                                              ~14     !3, !2
         15        ASSIGN                                                   !4, ~14
    8    16        INIT_FCALL                                               'floor'
         17        DIV                                              ~16     !4, 60
         18        DIV                                              ~17     ~16, 60
         19        DIV                                              ~18     ~17, 24
         20        SEND_VAL                                                 ~18
         21        DO_ICALL                                         $19     
         22        ASSIGN                                                   !5, $19
    9    23        INIT_FCALL                                               'floor'
         24        DIV                                              ~21     !4, 60
         25        DIV                                              ~22     ~21, 60
         26        MUL                                              ~23     !5, 24
         27        SUB                                              ~24     ~22, ~23
         28        SEND_VAL                                                 ~24
         29        DO_ICALL                                         $25     
         30        ASSIGN                                                   !6, $25
   10    31        INIT_FCALL                                               'floor'
         32        DIV                                              ~27     !4, 60
         33        MUL                                              ~28     !6, 60
         34        SUB                                              ~29     ~27, ~28
         35        SEND_VAL                                                 ~29
         36        DO_ICALL                                         $30     
         37        ASSIGN                                                   !7, $30
   12    38        CONCAT                                           ~32     !5, '+'
         39        CONCAT                                           ~33     ~32, !6
         40        CONCAT                                           ~34     ~33, '+'
         41        CONCAT                                           ~35     ~34, !7
         42      > RETURN                                                   ~35
   13    43*     > RETURN                                                   null

End of function calcdays

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.39 ms | 1394 KiB | 16 Q