3v4l.org

run code in 300+ PHP versions simultaneously
<?php $startMemory = memory_get_usage(); echo 'START ' . $startMemory . 'bytes'; $array = range(1, 100000); foreach($array as $k=>$arr){ if($k%1000 == 0){ //echo memory_get_usage() - $startMemory, ' bytes'; } } echo 'Finnally' . memory_get_usage() - $startMemory, ' bytes';
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 12, Position 2 = 18
Branch analysis from position: 12
2 jumps found. (Code = 78) Position 1 = 13, Position 2 = 18
Branch analysis from position: 13
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 17
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
Branch analysis from position: 17
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
filename:       /in/XFYJl
function name:  (null)
number of ops:  26
compiled vars:  !0 = $startMemory, !1 = $array, !2 = $arr, !3 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'memory_get_usage'
          1        DO_ICALL                                         $4      
          2        ASSIGN                                                   !0, $4
    3     3        CONCAT                                           ~6      'START+', !0
          4        CONCAT                                           ~7      ~6, 'bytes'
          5        ECHO                                                     ~7
    4     6        INIT_FCALL                                               'range'
          7        SEND_VAL                                                 1
          8        SEND_VAL                                                 100000
          9        DO_ICALL                                         $8      
         10        ASSIGN                                                   !1, $8
    6    11      > FE_RESET_R                                       $10     !1, ->18
         12    > > FE_FETCH_R                                       ~11     $10, !2, ->18
         13    >   ASSIGN                                                   !3, ~11
    7    14        MOD                                              ~13     !3, 1000
         15        IS_EQUAL                                                 ~13, 0
         16      > JMPZ                                                     ~14, ->17
    6    17    > > JMP                                                      ->12
         18    >   FE_FREE                                                  $10
   12    19        INIT_FCALL                                               'memory_get_usage'
         20        DO_ICALL                                         $15     
         21        SUB                                              ~16     $15, !0
         22        CONCAT                                           ~17     'Finnally', ~16
         23        ECHO                                                     ~17
         24        ECHO                                                     '+bytes'
         25      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.59 ms | 1395 KiB | 17 Q