3v4l.org

run code in 300+ PHP versions simultaneously
<?php for ($i = 0; $i < 100000; $i++) { $GLOBALS["a$i"] = rand(0, 1000000); } $start = microtime(true); for ($runs = 1000; $runs > 0; $runs--) { array_key_exists('a1111111', $GLOBALS); } $end = microtime(true); printf("[GLOBALS]array_key_exists() took %.5f seconds\n", $end - $start);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
2 jumps found. (Code = 44) Position 1 = 14, Position 2 = 2
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
2 jumps found. (Code = 44) Position 1 = 26, Position 2 = 20
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
2 jumps found. (Code = 44) Position 1 = 26, Position 2 = 20
Branch analysis from position: 26
Branch analysis from position: 20
Branch analysis from position: 2
2 jumps found. (Code = 44) Position 1 = 14, Position 2 = 2
Branch analysis from position: 14
Branch analysis from position: 2
filename:       /in/91CFl
function name:  (null)
number of ops:  36
compiled vars:  !0 = $i, !1 = $start, !2 = $runs, !3 = $end
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 0
          1      > JMP                                                      ->12
    4     2    >   NOP                                                      
          3        FAST_CONCAT                                      ~6      'a', !0
          4        INIT_FCALL                                               'rand'
          5        SEND_VAL                                                 0
          6        SEND_VAL                                                 1000000
          7        DO_ICALL                                         $8      
          8        FETCH_W                      global              $5      'GLOBALS'
          9        ASSIGN_DIM                                               $5, ~6
         10        OP_DATA                                                  $8
    3    11        PRE_INC                                                  !0
         12    >   IS_SMALLER                                               !0, 100000
         13      > JMPNZ                                                    ~10, ->2
    7    14    >   INIT_FCALL                                               'microtime'
         15        SEND_VAL                                                 <true>
         16        DO_ICALL                                         $11     
         17        ASSIGN                                                   !1, $11
    8    18        ASSIGN                                                   !2, 1000
         19      > JMP                                                      ->24
    9    20    >   FETCH_R                      global              ~14     'GLOBALS'
         21        ARRAY_KEY_EXISTS                                 ~15     'a1111111', ~14
         22        FREE                                                     ~15
    8    23        PRE_DEC                                                  !2
         24    >   IS_SMALLER                                               0, !2
         25      > JMPNZ                                                    ~17, ->20
   11    26    >   INIT_FCALL                                               'microtime'
         27        SEND_VAL                                                 <true>
         28        DO_ICALL                                         $18     
         29        ASSIGN                                                   !3, $18
   12    30        INIT_FCALL                                               'printf'
         31        SEND_VAL                                                 '%5BGLOBALS%5Darray_key_exists%28%29+took+%25.5f+seconds%0A'
         32        SUB                                              ~20     !3, !1
         33        SEND_VAL                                                 ~20
         34        DO_ICALL                                                 
         35      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
141.94 ms | 1400 KiB | 19 Q