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 ($useSec && $seconds < 10) { $seconds = "0" . $seconds; } $str = ''; if ($days > 0) { $str .= $days . 'd'; } $str = $str . $hours . ":" . $minutes; if ($useSec) { $str .= ":" . $seconds; } return $str; } echo xtemplate_formatter_secToTime(35353);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1WSmj
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   47     0  E >   INIT_FCALL                                               'xtemplate_formatter_sectotime'
          1        SEND_VAL                                                 35353
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
          4      > 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 = 46) Position 1 = 47, Position 2 = 49
Branch analysis from position: 47
2 jumps found. (Code = 43) Position 1 = 50, Position 2 = 52
Branch analysis from position: 50
2 jumps found. (Code = 43) Position 1 = 55, Position 2 = 57
Branch analysis from position: 55
2 jumps found. (Code = 43) Position 1 = 62, Position 2 = 64
Branch analysis from position: 62
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 64
Branch analysis from position: 57
Branch analysis from position: 52
Branch analysis from position: 49
Branch analysis from position: 46
Branch analysis from position: 42
Branch analysis from position: 38
Branch analysis from position: 32
filename:       /in/1WSmj
function name:  xtemplate_formatter_secToTime
number of ops:  66
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    > > JMPZ_EX                                          ~42     !1, ->49
         47    >   IS_SMALLER                                       ~43     !9, 10
         48        BOOL                                             ~42     ~43
         49    > > JMPZ                                                     ~42, ->52
   31    50    >   CONCAT                                           ~44     '0', !9
         51        ASSIGN                                                   !9, ~44
   34    52    >   ASSIGN                                                   !10, ''
   35    53        IS_SMALLER                                               0, !4
         54      > JMPZ                                                     ~47, ->57
   36    55    >   CONCAT                                           ~48     !4, 'd'
         56        ASSIGN_OP                                     8          !10, ~48
   38    57    >   CONCAT                                           ~50     !10, !6
         58        CONCAT                                           ~51     ~50, '%3A'
         59        CONCAT                                           ~52     ~51, !8
         60        ASSIGN                                                   !10, ~52
   40    61      > JMPZ                                                     !1, ->64
   41    62    >   CONCAT                                           ~54     '%3A', !9
         63        ASSIGN_OP                                     8          !10, ~54
   44    64    > > RETURN                                                   !10
   45    65*     > RETURN                                                   null

End of function xtemplate_formatter_sectotime

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.5 ms | 1402 KiB | 18 Q