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

End of function calcdays

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.74 ms | 1403 KiB | 16 Q