3v4l.org

run code in 300+ PHP versions simultaneously
<?php ini_set('memory_limit', '512M'); echo "Memory limit: ", ini_get('memory_limit'), "\n\n"; $finfo = new finfo(FILEINFO_MIME_TYPE); $minSize = 128 * 1024; $maxSize = 16 * 1024 * 1024; for($size = $minSize; $size <= $maxSize; $size *= 2) { $content = str_repeat('0', $size); echo "Content size: ", number_format(strlen($content)/1024/1024, 1), "M\n"; $finfo->buffer($content); echo "Peak memory usage: ", number_format(memory_get_peak_usage(true)/1024/1024, 1), "M\n\n"; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 49
Branch analysis from position: 49
2 jumps found. (Code = 44) Position 1 = 51, Position 2 = 18
Branch analysis from position: 51
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
2 jumps found. (Code = 44) Position 1 = 51, Position 2 = 18
Branch analysis from position: 51
Branch analysis from position: 18
filename:       /in/LNNoV
function name:  (null)
number of ops:  52
compiled vars:  !0 = $finfo, !1 = $minSize, !2 = $maxSize, !3 = $size, !4 = $content
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'ini_set'
          1        SEND_VAL                                                 'memory_limit'
          2        SEND_VAL                                                 '512M'
          3        DO_ICALL                                                 
    4     4        ECHO                                                     'Memory+limit%3A+'
          5        INIT_FCALL                                               'ini_get'
          6        SEND_VAL                                                 'memory_limit'
          7        DO_ICALL                                         $6      
          8        ECHO                                                     $6
          9        ECHO                                                     '%0A%0A'
    6    10        NEW                                              $7      'finfo'
         11        SEND_VAL_EX                                              16
         12        DO_FCALL                                      0          
         13        ASSIGN                                                   !0, $7
    7    14        ASSIGN                                                   !1, 131072
    8    15        ASSIGN                                                   !2, 16777216
    9    16        ASSIGN                                                   !3, !1
         17      > JMP                                                      ->49
   10    18    >   INIT_FCALL                                               'str_repeat'
         19        SEND_VAL                                                 '0'
         20        SEND_VAR                                                 !3
         21        DO_ICALL                                         $13     
         22        ASSIGN                                                   !4, $13
   11    23        ECHO                                                     'Content+size%3A+'
         24        INIT_FCALL                                               'number_format'
         25        STRLEN                                           ~15     !4
         26        DIV                                              ~16     ~15, 1024
         27        DIV                                              ~17     ~16, 1024
         28        SEND_VAL                                                 ~17
         29        SEND_VAL                                                 1
         30        DO_ICALL                                         $18     
         31        ECHO                                                     $18
         32        ECHO                                                     'M%0A'
   13    33        INIT_METHOD_CALL                                         !0, 'buffer'
         34        SEND_VAR_EX                                              !4
         35        DO_FCALL                                      0          
   14    36        ECHO                                                     'Peak+memory+usage%3A+'
         37        INIT_FCALL                                               'number_format'
         38        INIT_FCALL                                               'memory_get_peak_usage'
         39        SEND_VAL                                                 <true>
         40        DO_ICALL                                         $20     
         41        DIV                                              ~21     $20, 1024
         42        DIV                                              ~22     ~21, 1024
         43        SEND_VAL                                                 ~22
         44        SEND_VAL                                                 1
         45        DO_ICALL                                         $23     
         46        ECHO                                                     $23
         47        ECHO                                                     'M%0A%0A'
    9    48        ASSIGN_OP                                     3          !3, 2
         49    >   IS_SMALLER_OR_EQUAL                                      !3, !2
         50      > JMPNZ                                                    ~25, ->18
   15    51    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.05 ms | 1400 KiB | 23 Q