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

End of function calcdays

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.8 ms | 1402 KiB | 16 Q