3v4l.org

run code in 500+ PHP versions simultaneously
<?php $arr = array_fill(0, 100000, true); printf("%.2f mb\n", memory_get_peak_usage() / 1024 / 1024); foreach ($arr as $value) { break; } printf("%.2f mb\n", memory_get_peak_usage() / 1024 / 1024); foreach (array_keys($arr) as $value) { break; } printf("%.2f mb\n", memory_get_peak_usage() / 1024 / 1024);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 15, Position 2 = 18
Branch analysis from position: 15
2 jumps found. (Code = 78) Position 1 = 16, Position 2 = 18
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
2 jumps found. (Code = 77) Position 1 = 31, Position 2 = 34
Branch analysis from position: 31
2 jumps found. (Code = 78) Position 1 = 32, Position 2 = 34
Branch analysis from position: 32
1 jumps found. (Code = 42) Position 1 = 34
Branch analysis from position: 34
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 34
Branch analysis from position: 34
Branch analysis from position: 18
Branch analysis from position: 18
filename:       /in/MRSv6
function name:  (null)
number of ops:  44
compiled vars:  !0 = $arr, !1 = $value
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                                   'array_fill'
          1        SEND_VAL                                                     0
          2        SEND_VAL                                                     100000
          3        SEND_VAL                                                     <true>
          4        DO_ICALL                                             $2      
          5        ASSIGN                                                       !0, $2
    5     6        INIT_FCALL                                                   'printf'
          7        SEND_VAL                                                     '%25.2f+mb%0A'
          8        INIT_FCALL                                                   'memory_get_peak_usage'
          9        DO_ICALL                                             $4      
         10        DIV                                                  ~5      $4, 1024
         11        DIV                                                  ~6      ~5, 1024
         12        SEND_VAL                                                     ~6
         13        DO_ICALL                                                     
    7    14      > FE_RESET_R                                           $8      !0, ->18
         15    > > FE_FETCH_R                                                   $8, !1, ->18
    8    16    > > JMP                                                          ->18
    7    17*       JMP                                                          ->15
         18    >   FE_FREE                                                      $8
   11    19        INIT_FCALL                                                   'printf'
         20        SEND_VAL                                                     '%25.2f+mb%0A'
         21        INIT_FCALL                                                   'memory_get_peak_usage'
         22        DO_ICALL                                             $9      
         23        DIV                                                  ~10     $9, 1024
         24        DIV                                                  ~11     ~10, 1024
         25        SEND_VAL                                                     ~11
         26        DO_ICALL                                                     
   13    27        INIT_FCALL                                                   'array_keys'
         28        SEND_VAR                                                     !0
         29        DO_ICALL                                             $13     
         30      > FE_RESET_R                                           $14     $13, ->34
         31    > > FE_FETCH_R                                                   $14, !1, ->34
   14    32    > > JMP                                                          ->34
   13    33*       JMP                                                          ->31
         34    >   FE_FREE                                                      $14
   17    35        INIT_FCALL                                                   'printf'
         36        SEND_VAL                                                     '%25.2f+mb%0A'
         37        INIT_FCALL                                                   'memory_get_peak_usage'
         38        DO_ICALL                                             $15     
         39        DIV                                                  ~16     $15, 1024
         40        DIV                                                  ~17     ~16, 1024
         41        SEND_VAL                                                     ~17
         42        DO_ICALL                                                     
         43      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
162.21 ms | 2104 KiB | 17 Q