3v4l.org

run code in 300+ PHP versions simultaneously
<?php function decimal_to_time($decimal) { $hours = floor($decimal / 60); $minutes = floor($decimal % 60); $seconds = $decimal - (int)$decimal; $seconds = round($seconds * 60); return str_pad($hours, 2, "0", STR_PAD_LEFT) . ":" . str_pad($minutes, 2, "0", STR_PAD_LEFT) . ":" . str_pad($seconds, 2, "0", STR_PAD_LEFT); } echo decimal_to_time(1028);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XG8tF
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   INIT_FCALL                                               'decimal_to_time'
          1        SEND_VAL                                                 1028
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
          4      > RETURN                                                   1

Function decimal_to_time:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XG8tF
function name:  decimal_to_time
number of ops:  43
compiled vars:  !0 = $decimal, !1 = $hours, !2 = $minutes, !3 = $seconds
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        INIT_FCALL                                               'floor'
          2        DIV                                              ~4      !0, 60
          3        SEND_VAL                                                 ~4
          4        DO_ICALL                                         $5      
          5        ASSIGN                                                   !1, $5
    5     6        INIT_FCALL                                               'floor'
          7        MOD                                              ~7      !0, 60
          8        SEND_VAL                                                 ~7
          9        DO_ICALL                                         $8      
         10        ASSIGN                                                   !2, $8
    6    11        CAST                                          4  ~10     !0
         12        SUB                                              ~11     !0, ~10
         13        ASSIGN                                                   !3, ~11
    7    14        INIT_FCALL                                               'round'
         15        MUL                                              ~13     !3, 60
         16        SEND_VAL                                                 ~13
         17        DO_ICALL                                         $14     
         18        ASSIGN                                                   !3, $14
    9    19        INIT_FCALL                                               'str_pad'
         20        SEND_VAR                                                 !1
         21        SEND_VAL                                                 2
         22        SEND_VAL                                                 '0'
         23        SEND_VAL                                                 0
         24        DO_ICALL                                         $16     
         25        CONCAT                                           ~17     $16, '%3A'
         26        INIT_FCALL                                               'str_pad'
         27        SEND_VAR                                                 !2
         28        SEND_VAL                                                 2
         29        SEND_VAL                                                 '0'
         30        SEND_VAL                                                 0
         31        DO_ICALL                                         $18     
         32        CONCAT                                           ~19     ~17, $18
         33        CONCAT                                           ~20     ~19, '%3A'
         34        INIT_FCALL                                               'str_pad'
         35        SEND_VAR                                                 !3
         36        SEND_VAL                                                 2
         37        SEND_VAL                                                 '0'
         38        SEND_VAL                                                 0
         39        DO_ICALL                                         $21     
         40        CONCAT                                           ~22     ~20, $21
         41      > RETURN                                                   ~22
   10    42*     > RETURN                                                   null

End of function decimal_to_time

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.62 ms | 1403 KiB | 20 Q