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

End of function calcdays

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
190.92 ms | 1394 KiB | 16 Q