3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = []; $t1 = hrtime(true); for ($i = 0; $i < 6000000; $i++) { \array_key_exists("key", $array); } $t2 = hrtime(true); $t3 = hrtime(true); for ($i = 0; $i < 6000000; $i++) { isset($array["key"]); } $t4 = hrtime(true); echo "With function: " . (($t2 - $t1) / 1000000) . " ms\n"; echo "With isset : " . (($t4 - $t3) / 1000000) . " ms\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
2 jumps found. (Code = 44) Position 1 = 12, Position 2 = 7
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 25
Branch analysis from position: 25
2 jumps found. (Code = 44) Position 1 = 27, Position 2 = 22
Branch analysis from position: 27
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
2 jumps found. (Code = 44) Position 1 = 27, Position 2 = 22
Branch analysis from position: 27
Branch analysis from position: 22
Branch analysis from position: 7
2 jumps found. (Code = 44) Position 1 = 12, Position 2 = 7
Branch analysis from position: 12
Branch analysis from position: 7
filename:       /in/OHTBO
function name:  (null)
number of ops:  42
compiled vars:  !0 = $array, !1 = $t1, !2 = $i, !3 = $t2, !4 = $t3, !5 = $t4
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1        INIT_FCALL                                               'hrtime'
          2        SEND_VAL                                                 <true>
          3        DO_ICALL                                         $7      
          4        ASSIGN                                                   !1, $7
    6     5        ASSIGN                                                   !2, 0
          6      > JMP                                                      ->10
    7     7    >   ARRAY_KEY_EXISTS                                 ~10     'key', !0
          8        FREE                                                     ~10
    6     9        PRE_INC                                                  !2
         10    >   IS_SMALLER                                               !2, 6000000
         11      > JMPNZ                                                    ~12, ->7
    9    12    >   INIT_FCALL                                               'hrtime'
         13        SEND_VAL                                                 <true>
         14        DO_ICALL                                         $13     
         15        ASSIGN                                                   !3, $13
   11    16        INIT_FCALL                                               'hrtime'
         17        SEND_VAL                                                 <true>
         18        DO_ICALL                                         $15     
         19        ASSIGN                                                   !4, $15
   12    20        ASSIGN                                                   !2, 0
         21      > JMP                                                      ->25
   13    22    >   ISSET_ISEMPTY_DIM_OBJ                         0  ~18     !0, 'key'
         23        FREE                                                     ~18
   12    24        PRE_INC                                                  !2
         25    >   IS_SMALLER                                               !2, 6000000
         26      > JMPNZ                                                    ~20, ->22
   15    27    >   INIT_FCALL                                               'hrtime'
         28        SEND_VAL                                                 <true>
         29        DO_ICALL                                         $21     
         30        ASSIGN                                                   !5, $21
   17    31        SUB                                              ~23     !3, !1
         32        DIV                                              ~24     ~23, 1000000
         33        CONCAT                                           ~25     'With+function%3A+', ~24
         34        CONCAT                                           ~26     ~25, '+ms%0A'
         35        ECHO                                                     ~26
   18    36        SUB                                              ~27     !5, !4
         37        DIV                                              ~28     ~27, 1000000
         38        CONCAT                                           ~29     'With+isset+++%3A+', ~28
         39        CONCAT                                           ~30     ~29, '+ms%0A'
         40        ECHO                                                     ~30
         41      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
139.56 ms | 1441 KiB | 14 Q