3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = range(1,100000); echo memory_get_usage(), "\n"; foreach ($a as $i => $v) { if (!$i){ echo memory_get_usage(), "\n"; $a[$i] = 111; echo memory_get_usage(), "\n"; } } echo memory_get_usage(), "\n";
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 10, Position 2 = 25
Branch analysis from position: 10
2 jumps found. (Code = 78) Position 1 = 11, Position 2 = 25
Branch analysis from position: 11
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 24
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
Branch analysis from position: 24
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
filename:       /in/MnYFM
function name:  (null)
number of ops:  31
compiled vars:  !0 = $a, !1 = $v, !2 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'range'
          1        SEND_VAL                                                 1
          2        SEND_VAL                                                 100000
          3        DO_ICALL                                         $3      
          4        ASSIGN                                                   !0, $3
    3     5        INIT_FCALL                                               'memory_get_usage'
          6        DO_ICALL                                         $5      
          7        ECHO                                                     $5
          8        ECHO                                                     '%0A'
    4     9      > FE_RESET_R                                       $6      !0, ->25
         10    > > FE_FETCH_R                                       ~7      $6, !1, ->25
         11    >   ASSIGN                                                   !2, ~7
    5    12        BOOL_NOT                                         ~9      !2
         13      > JMPZ                                                     ~9, ->24
    6    14    >   INIT_FCALL                                               'memory_get_usage'
         15        DO_ICALL                                         $10     
         16        ECHO                                                     $10
         17        ECHO                                                     '%0A'
    7    18        ASSIGN_DIM                                               !0, !2
         19        OP_DATA                                                  111
    8    20        INIT_FCALL                                               'memory_get_usage'
         21        DO_ICALL                                         $12     
         22        ECHO                                                     $12
         23        ECHO                                                     '%0A'
    4    24    > > JMP                                                      ->10
         25    >   FE_FREE                                                  $6
   11    26        INIT_FCALL                                               'memory_get_usage'
         27        DO_ICALL                                         $13     
         28        ECHO                                                     $13
         29        ECHO                                                     '%0A'
         30      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.39 ms | 1396 KiB | 17 Q