3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = []; for($i = 0; $i < 800000; $i++) { $data[] = "あ"; } echo "point1:".memory_get_usage()."\n"; while(list($key, $value) = each($data)) {} echo "point2:".memory_get_usage()."\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 8, Position 2 = 3
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
2 jumps found. (Code = 44) Position 1 = 22, Position 2 = 14
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
Branch analysis from position: 3
2 jumps found. (Code = 44) Position 1 = 8, Position 2 = 3
Branch analysis from position: 8
Branch analysis from position: 3
filename:       /in/H6Tre
function name:  (null)
number of ops:  28
compiled vars:  !0 = $data, !1 = $i, !2 = $key, !3 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    3     1        ASSIGN                                                   !1, 0
          2      > JMP                                                      ->6
    4     3    >   ASSIGN_DIM                                               !0
          4        OP_DATA                                                  '%E3%81%82'
    3     5        PRE_INC                                                  !1
          6    >   IS_SMALLER                                               !1, 800000
          7      > JMPNZ                                                    ~8, ->3
    6     8    >   INIT_FCALL                                               'memory_get_usage'
          9        DO_ICALL                                         $9      
         10        CONCAT                                           ~10     'point1%3A', $9
         11        CONCAT                                           ~11     ~10, '%0A'
         12        ECHO                                                     ~11
    7    13      > JMP                                                      ->14
         14    >   INIT_FCALL_BY_NAME                                       'each'
         15        SEND_VAR_EX                                              !0
         16        DO_FCALL                                      0  $12     
         17        FETCH_LIST_R                                     $13     $12, 0
         18        ASSIGN                                                   !2, $13
         19        FETCH_LIST_R                                     $15     $12, 1
         20        ASSIGN                                                   !3, $15
         21      > JMPNZ                                                    $12, ->14
    8    22    >   INIT_FCALL                                               'memory_get_usage'
         23        DO_ICALL                                         $17     
         24        CONCAT                                           ~18     'point2%3A', $17
         25        CONCAT                                           ~19     ~18, '%0A'
         26        ECHO                                                     ~19
         27      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.39 ms | 1396 KiB | 15 Q