3v4l.org

run code in 300+ PHP versions simultaneously
<?php // spl $SplFixedArray = new SplFixedArray(1024 * 1024); // array(); for ($i = 0; $i < 1024 * 1024; ++$i) $SplFixedArray[$i] = 0; echo 'SplFixedArray: ' . memory_get_peak_usage() . PHP_EOL; // 标准array $array = array(1024 * 1024); // array(); for ($i = 0; $i < 1024 * 1024; ++$i) $array[$i] = 0; echo 'Standard array: '.memory_get_peak_usage() . PHP_EOL;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
2 jumps found. (Code = 44) Position 1 = 11, Position 2 = 6
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
2 jumps found. (Code = 44) Position 1 = 24, Position 2 = 19
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
2 jumps found. (Code = 44) Position 1 = 24, Position 2 = 19
Branch analysis from position: 24
Branch analysis from position: 19
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 11, Position 2 = 6
Branch analysis from position: 11
Branch analysis from position: 6
filename:       /in/6Ijqb
function name:  (null)
number of ops:  30
compiled vars:  !0 = $SplFixedArray, !1 = $i, !2 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $3      'SplFixedArray'
          1        SEND_VAL_EX                                              1048576
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $3
    4     4        ASSIGN                                                   !1, 0
          5      > JMP                                                      ->9
    5     6    >   ASSIGN_DIM                                               !0, !1
          7        OP_DATA                                                  0
    4     8        PRE_INC                                                  !1
          9    >   IS_SMALLER                                               !1, 1048576
         10      > JMPNZ                                                    ~9, ->6
    7    11    >   INIT_FCALL                                               'memory_get_peak_usage'
         12        DO_ICALL                                         $10     
         13        CONCAT                                           ~11     'SplFixedArray%3A+', $10
         14        CONCAT                                           ~12     ~11, '%0A'
         15        ECHO                                                     ~12
   10    16        ASSIGN                                                   !2, <array>
   11    17        ASSIGN                                                   !1, 0
         18      > JMP                                                      ->22
   12    19    >   ASSIGN_DIM                                               !2, !1
         20        OP_DATA                                                  0
   11    21        PRE_INC                                                  !1
         22    >   IS_SMALLER                                               !1, 1048576
         23      > JMPNZ                                                    ~17, ->19
   14    24    >   INIT_FCALL                                               'memory_get_peak_usage'
         25        DO_ICALL                                         $18     
         26        CONCAT                                           ~19     'Standard+array%3A+', $18
         27        CONCAT                                           ~20     ~19, '%0A'
         28        ECHO                                                     ~20
         29      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161 ms | 1396 KiB | 15 Q