3v4l.org

run code in 300+ PHP versions simultaneously
<?php function formatDuration($sec){ $h = floor($sec/(60*60)); $m = floor(($sec%60)/60); $s = floor(($sec%60)%60); return sprintf("%02d:%02d:%02d", $h, $m, $s); } for ($i=0; $i < 60*60*1.5; $i+=150){ echo formatDuration($i), PHP_EOL; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
2 jumps found. (Code = 44) Position 1 = 10, Position 2 = 2
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 2
2 jumps found. (Code = 44) Position 1 = 10, Position 2 = 2
Branch analysis from position: 10
Branch analysis from position: 2
filename:       /in/Aan8A
function name:  (null)
number of ops:  11
compiled vars:  !0 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   ASSIGN                                                   !0, 0
          1      > JMP                                                      ->8
   11     2    >   INIT_FCALL                                               'formatduration'
          3        SEND_VAR                                                 !0
          4        DO_FCALL                                      0  $2      
          5        ECHO                                                     $2
          6        ECHO                                                     '%0A'
   10     7        ASSIGN_OP                                     1          !0, 150
          8    >   IS_SMALLER                                               !0, 5400
          9      > JMPNZ                                                    ~4, ->2
   12    10    > > RETURN                                                   1

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

End of function formatduration

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
184.63 ms | 1403 KiB | 18 Q