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; $month = -20; $days = floor($inbetween / 60 / 60 / 24 - $month + 25); $hours = floor($inbetween / 60 / 60 % 24); $minutes = floor($inbetween / 60 % $hour); var_dump($hour); $seconds = $inbetween % $minute; 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/EMG2o
function name:  (null)
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     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/EMG2o
function name:  calcDays
number of ops:  61
compiled vars:  !0 = $startdate, !1 = $enddate, !2 = $first, !3 = $second, !4 = $inbetween, !5 = $minute, !6 = $hour, !7 = $day, !8 = $week, !9 = $month, !10 = $days, !11 = $hours, !12 = $minutes, !13 = $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                                                     ~14, ->6
          4    >   QM_ASSIGN                                        ~15     !0
          5      > JMP                                                      ->7
          6    >   QM_ASSIGN                                        ~15     !1
          7    >   ASSIGN                                                   !2, ~15
    5     8        IS_SMALLER                                               !0, !1
          9      > JMPZ                                                     ~17, ->12
         10    >   QM_ASSIGN                                        ~18     !1
         11      > JMP                                                      ->13
         12    >   QM_ASSIGN                                        ~18     !0
         13    >   ASSIGN                                                   !3, ~18
    6    14        SUB                                              ~20     !3, !2
         15        ASSIGN                                                   !4, ~20
    8    16        ASSIGN                                                   !5, 60
    9    17        MUL                                              ~23     !5, 60
         18        ASSIGN                                                   !6, ~23
   10    19        MUL                                              ~25     !6, 24
         20        ASSIGN                                                   !7, ~25
   11    21        MUL                                              ~27     !7, 7
         22        ASSIGN                                                   !8, ~27
   13    23        ASSIGN                                                   !9, -20
   14    24        INIT_FCALL                                               'floor'
         25        DIV                                              ~30     !4, 60
         26        DIV                                              ~31     ~30, 60
         27        DIV                                              ~32     ~31, 24
         28        SUB                                              ~33     ~32, !9
         29        ADD                                              ~34     ~33, 25
         30        SEND_VAL                                                 ~34
         31        DO_ICALL                                         $35     
         32        ASSIGN                                                   !10, $35
   15    33        INIT_FCALL                                               'floor'
         34        DIV                                              ~37     !4, 60
         35        DIV                                              ~38     ~37, 60
         36        MOD                                              ~39     ~38, 24
         37        SEND_VAL                                                 ~39
         38        DO_ICALL                                         $40     
         39        ASSIGN                                                   !11, $40
   16    40        INIT_FCALL                                               'floor'
         41        DIV                                              ~42     !4, 60
         42        MOD                                              ~43     ~42, !6
         43        SEND_VAL                                                 ~43
         44        DO_ICALL                                         $44     
         45        ASSIGN                                                   !12, $44
   17    46        INIT_FCALL                                               'var_dump'
         47        SEND_VAR                                                 !6
         48        DO_ICALL                                                 
   18    49        MOD                                              ~47     !4, !5
         50        ASSIGN                                                   !13, ~47
   20    51        CONCAT                                           ~49     !10, '+'
         52        CONCAT                                           ~50     ~49, !11
         53        CONCAT                                           ~51     ~50, '+'
         54        CONCAT                                           ~52     ~51, !12
         55        CONCAT                                           ~53     ~52, '+'
         56        CONCAT                                           ~54     ~53, !13
         57        CONCAT                                           ~55     ~54, '+'
         58        CONCAT                                           ~56     ~55, !4
         59      > RETURN                                                   ~56
   21    60*     > RETURN                                                   null

End of function calcdays

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.82 ms | 1403 KiB | 18 Q