3v4l.org

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

Class NumericArray: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.96 ms | 945 KiB | 16 Q