3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
141.86 ms | 1400 KiB | 17 Q