3v4l.org

run code in 300+ PHP versions simultaneously
<?php function formatBytes($bytes, $precision = 2) { $base = log($size) / log(1024); $suffixes = array('', 'k', 'M', 'G', 'T'); return round(pow(1024, $base - floor($base)), $precision) . $suffixes[floor($base)]; } echo fb1(24962496);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3Mggk
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   INIT_FCALL_BY_NAME                                       'fb1'
          1        SEND_VAL_EX                                              24962496
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
          4      > RETURN                                                   1

Function formatbytes:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3Mggk
function name:  formatBytes
number of ops:  30
compiled vars:  !0 = $bytes, !1 = $precision, !2 = $base, !3 = $size, !4 = $suffixes
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      2
    4     2        INIT_FCALL                                               'log'
          3        SEND_VAR                                                 !3
          4        DO_ICALL                                         $5      
          5        INIT_FCALL                                               'log'
          6        SEND_VAL                                                 1024
          7        DO_ICALL                                         $6      
          8        DIV                                              ~7      $5, $6
          9        ASSIGN                                                   !2, ~7
    5    10        ASSIGN                                                   !4, <array>
    7    11        INIT_FCALL                                               'round'
         12        INIT_FCALL                                               'pow'
         13        SEND_VAL                                                 1024
         14        INIT_FCALL                                               'floor'
         15        SEND_VAR                                                 !2
         16        DO_ICALL                                         $10     
         17        SUB                                              ~11     !2, $10
         18        SEND_VAL                                                 ~11
         19        DO_ICALL                                         $12     
         20        SEND_VAR                                                 $12
         21        SEND_VAR                                                 !1
         22        DO_ICALL                                         $13     
         23        INIT_FCALL                                               'floor'
         24        SEND_VAR                                                 !2
         25        DO_ICALL                                         $14     
         26        FETCH_DIM_R                                      ~15     !4, $14
         27        CONCAT                                           ~16     $13, ~15
         28      > RETURN                                                   ~16
    8    29*     > RETURN                                                   null

End of function formatbytes

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.11 ms | 1396 KiB | 21 Q