3v4l.org

run code in 300+ PHP versions simultaneously
<?php $size = pow(2, 10); // 16 is just an example, could also be 15 or 17 $startTime = microtime(true); $array = array(); for ($key = 0, $maxKey = $size - 1; $key <= $maxKey; ++$key) { $array[$key] = 0; } $endTime = microtime(true); echo 'Inserting ', $size, ' good elements took ', $endTime - $startTime, ' seconds', "\n"; $startTime = microtime(true); $array = array(); for ($key = 0, $maxKey = ($size - 1) * $size; $key <= $maxKey; $key += $size) { $array[$key] = 0; } $endTime = microtime(true); echo 'Inserting ', $size, ' evil elements took ', $endTime - $startTime, ' seconds', "\n";
Finding entry points
Branch analysis from position: 0
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
1 jumps found. (Code = 62) Position 1 = -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/n05fH
function name:  (null)
number of ops:  57
compiled vars:  !0 = $size, !1 = $startTime, !2 = $array, !3 = $key, !4 = $maxKey, !5 = $endTime
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'pow'
          1        SEND_VAL                                                 2
          2        SEND_VAL                                                 10
          3        DO_ICALL                                         $6      
          4        ASSIGN                                                   !0, $6
    4     5        INIT_FCALL                                               'microtime'
          6        SEND_VAL                                                 <true>
          7        DO_ICALL                                         $8      
          8        ASSIGN                                                   !1, $8
    6     9        ASSIGN                                                   !2, <array>
    7    10        ASSIGN                                                   !3, 0
         11        SUB                                              ~12     !0, 1
         12        ASSIGN                                                   !4, ~12
         13      > JMP                                                      ->17
    8    14    >   ASSIGN_DIM                                               !2, !3
         15        OP_DATA                                                  0
    7    16        PRE_INC                                                  !3
         17    >   IS_SMALLER_OR_EQUAL                                      !3, !4
         18      > JMPNZ                                                    ~16, ->14
   11    19    >   INIT_FCALL                                               'microtime'
         20        SEND_VAL                                                 <true>
         21        DO_ICALL                                         $17     
         22        ASSIGN                                                   !5, $17
   13    23        ECHO                                                     'Inserting+'
         24        ECHO                                                     !0
         25        ECHO                                                     '+good+elements+took+'
         26        SUB                                              ~19     !5, !1
         27        ECHO                                                     ~19
         28        ECHO                                                     '+seconds'
         29        ECHO                                                     '%0A'
   15    30        INIT_FCALL                                               'microtime'
         31        SEND_VAL                                                 <true>
         32        DO_ICALL                                         $20     
         33        ASSIGN                                                   !1, $20
   17    34        ASSIGN                                                   !2, <array>
   18    35        ASSIGN                                                   !3, 0
         36        SUB                                              ~24     !0, 1
         37        MUL                                              ~25     !0, ~24
         38        ASSIGN                                                   !4, ~25
         39      > JMP                                                      ->43
   19    40    >   ASSIGN_DIM                                               !2, !3
         41        OP_DATA                                                  0
   18    42        ASSIGN_OP                                     1          !3, !0
         43    >   IS_SMALLER_OR_EQUAL                                      !3, !4
         44      > JMPNZ                                                    ~29, ->40
   22    45    >   INIT_FCALL                                               'microtime'
         46        SEND_VAL                                                 <true>
         47        DO_ICALL                                         $30     
         48        ASSIGN                                                   !5, $30
   24    49        ECHO                                                     'Inserting+'
         50        ECHO                                                     !0
         51        ECHO                                                     '+evil+elements+took+'
         52        SUB                                              ~32     !5, !1
         53        ECHO                                                     ~32
         54        ECHO                                                     '+seconds'
         55        ECHO                                                     '%0A'
         56      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.59 ms | 1400 KiB | 17 Q