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; $i[2] = 7; $i[3] = date('t', strtotime('-2 months', $second)); var_dump($i[3]); $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(1388389166, 1391067556);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/312V7
function name:  (null)
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   INIT_FCALL                                               'calcdays'
          1        SEND_VAL                                                 1388389166
          2        SEND_VAL                                                 1391067556
          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/312V7
function name:  calcDays
number of ops:  72
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
   10    20        ASSIGN_DIM                                               !5, 2
         21        OP_DATA                                                  7
   11    22        INIT_FCALL                                               'date'
         23        SEND_VAL                                                 't'
         24        INIT_FCALL                                               'strtotime'
         25        SEND_VAL                                                 '-2+months'
         26        SEND_VAR                                                 !3
         27        DO_ICALL                                         $23     
         28        SEND_VAR                                                 $23
         29        DO_ICALL                                         $24     
         30        ASSIGN_DIM                                               !5, 3
         31        OP_DATA                                                  $24
   13    32        INIT_FCALL                                               'var_dump'
         33        FETCH_DIM_R                                      ~25     !5, 3
         34        SEND_VAL                                                 ~25
         35        DO_ICALL                                                 
   15    36        ASSIGN                                                   !6, -20
   16    37        INIT_FCALL                                               'floor'
         38        DIV                                              ~28     !4, 60
         39        DIV                                              ~29     ~28, 60
         40        DIV                                              ~30     ~29, 24
         41        SEND_VAL                                                 ~30
         42        DO_ICALL                                         $31     
         43        ASSIGN                                                   !7, $31
   17    44        INIT_FCALL                                               'floor'
         45        DIV                                              ~33     !4, 60
         46        DIV                                              ~34     ~33, 60
         47        FETCH_DIM_R                                      ~35     !5, 1
         48        MOD                                              ~36     ~34, ~35
         49        SEND_VAL                                                 ~36
         50        DO_ICALL                                         $37     
         51        ASSIGN                                                   !8, $37
   18    52        INIT_FCALL                                               'floor'
         53        DIV                                              ~39     !4, 60
         54        FETCH_DIM_R                                      ~40     !5, 0
         55        MOD                                              ~41     ~39, ~40
         56        SEND_VAL                                                 ~41
         57        DO_ICALL                                         $42     
         58        ASSIGN                                                   !9, $42
   19    59        FETCH_DIM_R                                      ~44     !5, 0
         60        MOD                                              ~45     !4, ~44
         61        ASSIGN                                                   !10, ~45
   21    62        CONCAT                                           ~47     !7, '+'
         63        CONCAT                                           ~48     ~47, !8
         64        CONCAT                                           ~49     ~48, '+'
         65        CONCAT                                           ~50     ~49, !9
         66        CONCAT                                           ~51     ~50, '+'
         67        CONCAT                                           ~52     ~51, !10
         68        CONCAT                                           ~53     ~52, '+'
         69        CONCAT                                           ~54     ~53, !4
         70      > RETURN                                                   ~54
   22    71*     > RETURN                                                   null

End of function calcdays

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.86 ms | 1403 KiB | 22 Q