3v4l.org

run code in 300+ PHP versions simultaneously
<?php for($size = 10; $size < 500; $size *= 2) { echo PHP_EOL . "Testing size: $size" . PHP_EOL; for($s = microtime(true), $container = array(), $i = 0; $i < $size; $i++) $container[$i] = NULL; echo "Array(): " . sprintf('%f', (microtime(true) - $s)) . ', mem: ' . memory_get_usage() . PHP_EOL; for($s = microtime(true), $container = new SplFixedArray($size), $i = 0; $i < $size; $i++) $container[$i] = NULL; echo "SplArray(): " . sprintf('%f', (microtime(true) - $s)) . ', mem: ' . memory_get_usage() . PHP_EOL; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 65
Branch analysis from position: 65
2 jumps found. (Code = 44) Position 1 = 67, Position 2 = 2
Branch analysis from position: 67
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 2
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
2 jumps found. (Code = 44) Position 1 = 19, Position 2 = 14
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 47
Branch analysis from position: 47
2 jumps found. (Code = 44) Position 1 = 49, Position 2 = 44
Branch analysis from position: 49
2 jumps found. (Code = 44) Position 1 = 67, Position 2 = 2
Branch analysis from position: 67
Branch analysis from position: 2
Branch analysis from position: 44
2 jumps found. (Code = 44) Position 1 = 49, Position 2 = 44
Branch analysis from position: 49
Branch analysis from position: 44
Branch analysis from position: 14
2 jumps found. (Code = 44) Position 1 = 19, Position 2 = 14
Branch analysis from position: 19
Branch analysis from position: 14
filename:       /in/K7QVi
function name:  (null)
number of ops:  68
compiled vars:  !0 = $size, !1 = $s, !2 = $container, !3 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 10
          1      > JMP                                                      ->65
    4     2    >   NOP                                                      
          3        FAST_CONCAT                                      ~5      'Testing+size%3A+', !0
          4        CONCAT                                           ~6      '%0A', ~5
          5        CONCAT                                           ~7      ~6, '%0A'
          6        ECHO                                                     ~7
    5     7        INIT_FCALL                                               'microtime'
          8        SEND_VAL                                                 <true>
          9        DO_ICALL                                         $8      
         10        ASSIGN                                                   !1, $8
         11        ASSIGN                                                   !2, <array>
         12        ASSIGN                                                   !3, 0
         13      > JMP                                                      ->17
         14    >   ASSIGN_DIM                                               !2, !3
         15        OP_DATA                                                  null
         16        PRE_INC                                                  !3
         17    >   IS_SMALLER                                               !3, !0
         18      > JMPNZ                                                    ~14, ->14
    6    19    >   INIT_FCALL                                               'sprintf'
         20        SEND_VAL                                                 '%25f'
         21        INIT_FCALL                                               'microtime'
         22        SEND_VAL                                                 <true>
         23        DO_ICALL                                         $15     
         24        SUB                                              ~16     $15, !1
         25        SEND_VAL                                                 ~16
         26        DO_ICALL                                         $17     
         27        CONCAT                                           ~18     'Array%28%29%3A+', $17
         28        CONCAT                                           ~19     ~18, '%2C+mem%3A+'
         29        INIT_FCALL                                               'memory_get_usage'
         30        DO_ICALL                                         $20     
         31        CONCAT                                           ~21     ~19, $20
         32        CONCAT                                           ~22     ~21, '%0A'
         33        ECHO                                                     ~22
    8    34        INIT_FCALL                                               'microtime'
         35        SEND_VAL                                                 <true>
         36        DO_ICALL                                         $23     
         37        ASSIGN                                                   !1, $23
         38        NEW                                              $25     'SplFixedArray'
         39        SEND_VAR_EX                                              !0
         40        DO_FCALL                                      0          
         41        ASSIGN                                                   !2, $25
         42        ASSIGN                                                   !3, 0
         43      > JMP                                                      ->47
         44    >   ASSIGN_DIM                                               !2, !3
         45        OP_DATA                                                  null
         46        PRE_INC                                                  !3
         47    >   IS_SMALLER                                               !3, !0
         48      > JMPNZ                                                    ~31, ->44
    9    49    >   INIT_FCALL                                               'sprintf'
         50        SEND_VAL                                                 '%25f'
         51        INIT_FCALL                                               'microtime'
         52        SEND_VAL                                                 <true>
         53        DO_ICALL                                         $32     
         54        SUB                                              ~33     $32, !1
         55        SEND_VAL                                                 ~33
         56        DO_ICALL                                         $34     
         57        CONCAT                                           ~35     'SplArray%28%29%3A+', $34
         58        CONCAT                                           ~36     ~35, '%2C+mem%3A+'
         59        INIT_FCALL                                               'memory_get_usage'
         60        DO_ICALL                                         $37     
         61        CONCAT                                           ~38     ~36, $37
         62        CONCAT                                           ~39     ~38, '%0A'
         63        ECHO                                                     ~39
    3    64        ASSIGN_OP                                     3          !0, 2
         65    >   IS_SMALLER                                               !0, 500
         66      > JMPNZ                                                    ~41, ->2
   10    67    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.24 ms | 1400 KiB | 19 Q