3v4l.org

run code in 300+ PHP versions simultaneously
<?php $bytes = 0|1; // Set the first commons International System of Units (SI) bytes Prefix $si_prefix = array( 'B', 'KB', 'MB', 'GB' ); $class = min( (int) log( $bytes , 1024 ), count( $si_prefix ) - 1 ); // We format the total bytes of cache as appropriate, either in B, KB, MB or GB $size = sprintf( '%1.2f', $bytes / pow( 1024, $class ) ) . ' ' . $si_prefix[ $class ]; // We calculated the percentage of cache used $percentage = ceil( $bytes / $max_size * 100 ); var_dump($class, $size, $percentage);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9lodG
function name:  (null)
number of ops:  39
compiled vars:  !0 = $bytes, !1 = $si_prefix, !2 = $class, !3 = $size, !4 = $percentage, !5 = $max_size
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 1
    6     1        ASSIGN                                                   !1, <array>
    7     2        INIT_FCALL                                               'min'
          3        INIT_FCALL                                               'log'
          4        SEND_VAR                                                 !0
          5        SEND_VAL                                                 1024
          6        DO_ICALL                                         $8      
          7        CAST                                          4  ~9      $8
          8        SEND_VAL                                                 ~9
          9        COUNT                                            ~10     !1
         10        SUB                                              ~11     ~10, 1
         11        SEND_VAL                                                 ~11
         12        DO_ICALL                                         $12     
         13        ASSIGN                                                   !2, $12
    9    14        INIT_FCALL                                               'sprintf'
         15        SEND_VAL                                                 '%251.2f'
         16        INIT_FCALL                                               'pow'
         17        SEND_VAL                                                 1024
         18        SEND_VAR                                                 !2
         19        DO_ICALL                                         $14     
         20        DIV                                              ~15     !0, $14
         21        SEND_VAL                                                 ~15
         22        DO_ICALL                                         $16     
         23        CONCAT                                           ~17     $16, '+'
         24        FETCH_DIM_R                                      ~18     !1, !2
         25        CONCAT                                           ~19     ~17, ~18
         26        ASSIGN                                                   !3, ~19
   11    27        INIT_FCALL                                               'ceil'
         28        DIV                                              ~21     !0, !5
         29        MUL                                              ~22     ~21, 100
         30        SEND_VAL                                                 ~22
         31        DO_ICALL                                         $23     
         32        ASSIGN                                                   !4, $23
   13    33        INIT_FCALL                                               'var_dump'
         34        SEND_VAR                                                 !2
         35        SEND_VAR                                                 !3
         36        SEND_VAR                                                 !4
         37        DO_ICALL                                                 
         38      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.04 ms | 1396 KiB | 25 Q