3v4l.org

run code in 500+ PHP versions simultaneously
<?php function secondsToTime(int $seconds): string { return sprintf('%02d:%02d:%02d', floor($seconds / 3600), floor($seconds / 60 % 60), $seconds % 60); } $data = [ 0, 55, 120, 3000, 26820, 50000, 86400, 150000, ]; foreach ($data as $seconds) { echo "$seconds seconds -> ", secondsToTime($seconds), PHP_EOL; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 12
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 12
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
filename:       /in/K17vi
function name:  (null)
number of ops:  14
compiled vars:  !0 = $data, !1 = $seconds
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    8     0  E >   ASSIGN                                                       !0, <array>
   18     1      > FE_RESET_R                                           $3      !0, ->12
          2    > > FE_FETCH_R                                                   $3, !1, ->12
   19     3    >   NOP                                                          
          4        FAST_CONCAT                                          ~4      !1, '+seconds+-%3E+'
          5        ECHO                                                         ~4
          6        INIT_FCALL                                                   'secondstotime'
          7        SEND_VAR                                                     !1
          8        DO_FCALL                                          0  $5      
          9        ECHO                                                         $5
         10        ECHO                                                         '%0A'
   18    11      > JMP                                                          ->2
         12    >   FE_FREE                                                      $3
   20    13      > RETURN                                                       1

Function secondstotime:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/K17vi
function name:  secondsToTime
number of ops:  21
compiled vars:  !0 = $seconds
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   RECV                                                 !0      
    5     1        INIT_FCALL                                                   'sprintf'
          2        SEND_VAL                                                     '%2502d%3A%2502d%3A%2502d'
          3        INIT_FCALL                                                   'floor'
          4        DIV                                                  ~1      !0, 3600
          5        SEND_VAL                                                     ~1
          6        DO_ICALL                                             $2      
          7        SEND_VAR                                                     $2
          8        INIT_FCALL                                                   'floor'
          9        DIV                                                  ~3      !0, 60
         10        MOD                                                  ~4      ~3, 60
         11        SEND_VAL                                                     ~4
         12        DO_ICALL                                             $5      
         13        SEND_VAR                                                     $5
         14        MOD                                                  ~6      !0, 60
         15        SEND_VAL                                                     ~6
         16        DO_ICALL                                             $7      
         17        VERIFY_RETURN_TYPE                                           $7
         18      > RETURN                                                       $7
    6    19*       VERIFY_RETURN_TYPE                                           
         20*     > RETURN                                                       null

End of function secondstotime

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
131.66 ms | 486 KiB | 10 Q