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(): " . (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(): " . (microtime(true) - $s) . ', mem: ' . memory_get_usage() . PHP_EOL; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 57
Branch analysis from position: 57
2 jumps found. (Code = 44) Position 1 = 59, Position 2 = 2
Branch analysis from position: 59
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 = 43
Branch analysis from position: 43
2 jumps found. (Code = 44) Position 1 = 45, Position 2 = 40
Branch analysis from position: 45
2 jumps found. (Code = 44) Position 1 = 59, Position 2 = 2
Branch analysis from position: 59
Branch analysis from position: 2
Branch analysis from position: 40
2 jumps found. (Code = 44) Position 1 = 45, Position 2 = 40
Branch analysis from position: 45
Branch analysis from position: 40
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/O9MiR
function name:  (null)
number of ops:  60
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                                                      ->57
    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                                               'microtime'
         20        SEND_VAL                                                 <true>
         21        DO_ICALL                                         $15     
         22        SUB                                              ~16     $15, !1
         23        CONCAT                                           ~17     'Array%28%29%3A+', ~16
         24        CONCAT                                           ~18     ~17, '%2C+mem%3A+'
         25        INIT_FCALL                                               'memory_get_usage'
         26        DO_ICALL                                         $19     
         27        CONCAT                                           ~20     ~18, $19
         28        CONCAT                                           ~21     ~20, '%0A'
         29        ECHO                                                     ~21
    8    30        INIT_FCALL                                               'microtime'
         31        SEND_VAL                                                 <true>
         32        DO_ICALL                                         $22     
         33        ASSIGN                                                   !1, $22
         34        NEW                                              $24     'SplFixedArray'
         35        SEND_VAR_EX                                              !0
         36        DO_FCALL                                      0          
         37        ASSIGN                                                   !2, $24
         38        ASSIGN                                                   !3, 0
         39      > JMP                                                      ->43
         40    >   ASSIGN_DIM                                               !2, !3
         41        OP_DATA                                                  null
         42        PRE_INC                                                  !3
         43    >   IS_SMALLER                                               !3, !0
         44      > JMPNZ                                                    ~30, ->40
    9    45    >   INIT_FCALL                                               'microtime'
         46        SEND_VAL                                                 <true>
         47        DO_ICALL                                         $31     
         48        SUB                                              ~32     $31, !1
         49        CONCAT                                           ~33     'SplArray%28%29%3A+', ~32
         50        CONCAT                                           ~34     ~33, '%2C+mem%3A+'
         51        INIT_FCALL                                               'memory_get_usage'
         52        DO_ICALL                                         $35     
         53        CONCAT                                           ~36     ~34, $35
         54        CONCAT                                           ~37     ~36, '%0A'
         55        ECHO                                                     ~37
    3    56        ASSIGN_OP                                     3          !0, 2
         57    >   IS_SMALLER                                               !0, 500
         58      > JMPNZ                                                    ~39, ->2
   10    59    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.95 ms | 1400 KiB | 17 Q