3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = range(0, 1e7); echo memory_get_peak_usage()/1024 . 'kB'; foreach ($array as $i => $a) { echo $a; } echo memory_get_peak_usage()/1024 . 'kB';
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 11, Position 2 = 15
Branch analysis from position: 11
2 jumps found. (Code = 78) Position 1 = 12, Position 2 = 15
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/Mh9hV
function name:  (null)
number of ops:  22
compiled vars:  !0 = $array, !1 = $a, !2 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'range'
          1        SEND_VAL                                                 0
          2        SEND_VAL                                                 1.0e+7
          3        DO_ICALL                                         $3      
          4        ASSIGN                                                   !0, $3
    4     5        INIT_FCALL                                               'memory_get_peak_usage'
          6        DO_ICALL                                         $5      
          7        DIV                                              ~6      $5, 1024
          8        CONCAT                                           ~7      ~6, 'kB'
          9        ECHO                                                     ~7
    5    10      > FE_RESET_R                                       $8      !0, ->15
         11    > > FE_FETCH_R                                       ~9      $8, !1, ->15
         12    >   ASSIGN                                                   !2, ~9
    6    13        ECHO                                                     !1
    5    14      > JMP                                                      ->11
         15    >   FE_FREE                                                  $8
    8    16        INIT_FCALL                                               'memory_get_peak_usage'
         17        DO_ICALL                                         $11     
         18        DIV                                              ~12     $11, 1024
         19        CONCAT                                           ~13     ~12, 'kB'
         20        ECHO                                                     ~13
         21      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.99 ms | 1395 KiB | 17 Q