3v4l.org

run code in 300+ PHP versions simultaneously
<?php function xtemplate_formatter_secToTime($rawSeconds, $useSec = false, $convertHoursToDays = false) { $allSeconds = abs($rawSeconds); $days = floor($allSeconds / 86400); $hoursSeconds = $allSeconds - 86400 * $days; $hours = floor($hoursSeconds / 3600); $minutesSeconds = $hoursSeconds - 3600 * $hours; $minutes = floor($minutesSeconds / 60); if ($useSec) { $seconds = $minutesSeconds - 60 * $minutes; } if (!$convertHoursToDays) { $hours = $days * 24 + $hours; $days = 0; } if ($hours < 10) { $hours = "0" . $hours; } if ($minutes < 10) { $minutes = "0" . $minutes; } if ($seconds < 10) { $seconds = "0" . $seconds; } $str = ''; if ($days > 0) { $str .= $days . 'd'; } $str = $str . $hours . ":" . $minutes; if ($seconds) { $str .= ":" . $seconds; } return $str; } xtemplate_formatter_secToTime(3433435353);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZLQ4W
function name:  (null)
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   47     0  E >   INIT_FCALL                                               'xtemplate_formatter_sectotime'
          1        SEND_VAL                                                 3433435353
          2        DO_FCALL                                      0          
          3      > RETURN                                                   1

Function xtemplate_formatter_sectotime:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 29, Position 2 = 32
Branch analysis from position: 29
2 jumps found. (Code = 43) Position 1 = 34, Position 2 = 38
Branch analysis from position: 34
2 jumps found. (Code = 43) Position 1 = 40, Position 2 = 42
Branch analysis from position: 40
2 jumps found. (Code = 43) Position 1 = 44, Position 2 = 46
Branch analysis from position: 44
2 jumps found. (Code = 43) Position 1 = 48, Position 2 = 50
Branch analysis from position: 48
2 jumps found. (Code = 43) Position 1 = 53, Position 2 = 55
Branch analysis from position: 53
2 jumps found. (Code = 43) Position 1 = 60, Position 2 = 62
Branch analysis from position: 60
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 62
Branch analysis from position: 55
Branch analysis from position: 50
Branch analysis from position: 46
Branch analysis from position: 42
Branch analysis from position: 38
Branch analysis from position: 32
filename:       /in/ZLQ4W
function name:  xtemplate_formatter_secToTime
number of ops:  64
compiled vars:  !0 = $rawSeconds, !1 = $useSec, !2 = $convertHoursToDays, !3 = $allSeconds, !4 = $days, !5 = $hoursSeconds, !6 = $hours, !7 = $minutesSeconds, !8 = $minutes, !9 = $seconds, !10 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      <false>
          2        RECV_INIT                                        !2      <false>
    6     3        INIT_FCALL                                               'abs'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $11     
          6        ASSIGN                                                   !3, $11
    7     7        INIT_FCALL                                               'floor'
          8        DIV                                              ~13     !3, 86400
          9        SEND_VAL                                                 ~13
         10        DO_ICALL                                         $14     
         11        ASSIGN                                                   !4, $14
    9    12        MUL                                              ~16     !4, 86400
         13        SUB                                              ~17     !3, ~16
         14        ASSIGN                                                   !5, ~17
   10    15        INIT_FCALL                                               'floor'
         16        DIV                                              ~19     !5, 3600
         17        SEND_VAL                                                 ~19
         18        DO_ICALL                                         $20     
         19        ASSIGN                                                   !6, $20
   12    20        MUL                                              ~22     !6, 3600
         21        SUB                                              ~23     !5, ~22
         22        ASSIGN                                                   !7, ~23
   13    23        INIT_FCALL                                               'floor'
         24        DIV                                              ~25     !7, 60
         25        SEND_VAL                                                 ~25
         26        DO_ICALL                                         $26     
         27        ASSIGN                                                   !8, $26
   15    28      > JMPZ                                                     !1, ->32
   16    29    >   MUL                                              ~28     !8, 60
         30        SUB                                              ~29     !7, ~28
         31        ASSIGN                                                   !9, ~29
   19    32    >   BOOL_NOT                                         ~31     !2
         33      > JMPZ                                                     ~31, ->38
   20    34    >   MUL                                              ~32     !4, 24
         35        ADD                                              ~33     ~32, !6
         36        ASSIGN                                                   !6, ~33
   21    37        ASSIGN                                                   !4, 0
   24    38    >   IS_SMALLER                                               !6, 10
         39      > JMPZ                                                     ~36, ->42
   25    40    >   CONCAT                                           ~37     '0', !6
         41        ASSIGN                                                   !6, ~37
   27    42    >   IS_SMALLER                                               !8, 10
         43      > JMPZ                                                     ~39, ->46
   28    44    >   CONCAT                                           ~40     '0', !8
         45        ASSIGN                                                   !8, ~40
   30    46    >   IS_SMALLER                                               !9, 10
         47      > JMPZ                                                     ~42, ->50
   31    48    >   CONCAT                                           ~43     '0', !9
         49        ASSIGN                                                   !9, ~43
   34    50    >   ASSIGN                                                   !10, ''
   35    51        IS_SMALLER                                               0, !4
         52      > JMPZ                                                     ~46, ->55
   36    53    >   CONCAT                                           ~47     !4, 'd'
         54        ASSIGN_OP                                     8          !10, ~47
   38    55    >   CONCAT                                           ~49     !10, !6
         56        CONCAT                                           ~50     ~49, '%3A'
         57        CONCAT                                           ~51     ~50, !8
         58        ASSIGN                                                   !10, ~51
   40    59      > JMPZ                                                     !9, ->62
   41    60    >   CONCAT                                           ~53     '%3A', !9
         61        ASSIGN_OP                                     8          !10, ~53
   44    62    > > RETURN                                                   !10
   45    63*     > RETURN                                                   null

End of function xtemplate_formatter_sectotime

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.35 ms | 1403 KiB | 18 Q