3v4l.org

run code in 300+ PHP versions simultaneously
<?php $size = 50000000000; function file_size($size) { $filesizename = array(" Bytes", " KB", " MB", " GB", " TB", " PB", " EB", " ZB", " YB"); return $size ? round($size/pow(1024, ($i = floor(log($size, 1024)))), 2) . $filesizename[$i] : '0 Bytes'; } echo file_size($size);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9G0Mr
function name:  (null)
number of ops:  6
compiled vars:  !0 = $size
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 50000000000
   10     1        INIT_FCALL                                               'file_size'
          2        SEND_VAR                                                 !0
          3        DO_FCALL                                      0  $2      
          4        ECHO                                                     $2
          5      > RETURN                                                   1

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

End of function file_size

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
172.29 ms | 1390 KiB | 22 Q