3v4l.org

run code in 300+ PHP versions simultaneously
<?php function byteConvert($bytes) { $s = array('B', 'Kb', 'MB', 'GB', 'TB', 'PB'); $e = floor(log($bytes)/log(1024)); return sprintf('%.2f '.$s[$e], ($bytes/pow(1024, floor($e)))); } var_dump(1024*1024*1024*48+198754);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/19d51
function name:  (null)
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   INIT_FCALL                                               'var_dump'
          1        SEND_VAL                                                 51539806306
          2        DO_ICALL                                                 
          3      > RETURN                                                   1

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

End of function byteconvert

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.61 ms | 1396 KiB | 23 Q