3v4l.org

run code in 300+ PHP versions simultaneously
<?php function to_pace($float_pace) { $fraction = $float_pace - floor($float_pace); $minutes = $float_pace - $fraction; $seconds = round($fraction * 60, 0); return sprintf("%02d:%02d", $minutes, $seconds); } echo $to_pace(5.08);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6KjV9
function name:  (null)
number of ops:  5
compiled vars:  !0 = $to_pace
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   INIT_DYNAMIC_CALL                                        !0
          1        SEND_VAL_EX                                              5.08
          2        DO_FCALL                                      0  $1      
          3        ECHO                                                     $1
          4      > RETURN                                                   1

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

End of function to_pace

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.01 ms | 1395 KiB | 19 Q