3v4l.org

run code in 300+ PHP versions simultaneously
<?php $size = pow(2, 16); // 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 = 18
Branch analysis from position: 18
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 15
Branch analysis from position: 20
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: 15
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 15
Branch analysis from position: 20
Branch analysis from position: 15
filename:       /in/2gWsZ
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                                                 16
          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        MUL                                              ~13     !0, ~12
         13        ASSIGN                                                   !4, ~13
         14      > JMP                                                      ->18
    8    15    >   ASSIGN_DIM                                               !2, !3
         16        OP_DATA                                                  0
    7    17        ASSIGN_OP                                     1          !3, !0
         18    >   IS_SMALLER_OR_EQUAL                                      !3, !4
         19      > JMPNZ                                                    ~17, ->15
   11    20    >   INIT_FCALL                                               'microtime'
         21        SEND_VAL                                                 <true>
         22        DO_ICALL                                         $18     
         23        ASSIGN                                                   !5, $18
   13    24        ECHO                                                     'Inserting+'
         25        ECHO                                                     !0
         26        ECHO                                                     '+evil+elements+took+'
         27        SUB                                              ~20     !5, !1
         28        ECHO                                                     ~20
         29        ECHO                                                     '+seconds'
         30        ECHO                                                     '%0A'
   15    31        INIT_FCALL                                               'microtime'
         32        SEND_VAL                                                 <true>
         33        DO_ICALL                                         $21     
         34        ASSIGN                                                   !1, $21
   17    35        ASSIGN                                                   !2, <array>
   18    36        ASSIGN                                                   !3, 0
         37        SUB                                              ~25     !0, 1
         38        ASSIGN                                                   !4, ~25
         39      > JMP                                                      ->43
   19    40    >   ASSIGN_DIM                                               !2, !3
         41        OP_DATA                                                  0
   18    42        PRE_INC                                                  !3
         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                                                     '+good+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:
154.53 ms | 1400 KiB | 17 Q