3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = array(); $fp = fopen("/usr/share/dict/words", "r"); while ($i < 5000 && ($w = fgets($fp))) { $arr[trim($w)] = ++$i; } $s = microtime(1); for ($i = 0; $i < 100000; $i++) { isset($arr['abracadabra']); } $e = microtime(1); echo "Isset: ".($e - $s)."\n"; $s = microtime(1); for ($i = 0; $i < 100000; $i++) { array_key_exists('abracadabra', $arr); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
2 jumps found. (Code = 46) Position 1 = 15, Position 2 = 20
Branch analysis from position: 15
2 jumps found. (Code = 44) Position 1 = 21, Position 2 = 7
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 30
Branch analysis from position: 30
2 jumps found. (Code = 44) Position 1 = 32, Position 2 = 27
Branch analysis from position: 32
1 jumps found. (Code = 42) Position 1 = 49
Branch analysis from position: 49
2 jumps found. (Code = 44) Position 1 = 51, Position 2 = 46
Branch analysis from position: 51
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 46
2 jumps found. (Code = 44) Position 1 = 51, Position 2 = 46
Branch analysis from position: 51
Branch analysis from position: 46
Branch analysis from position: 27
2 jumps found. (Code = 44) Position 1 = 32, Position 2 = 27
Branch analysis from position: 32
Branch analysis from position: 27
Branch analysis from position: 7
2 jumps found. (Code = 46) Position 1 = 15, Position 2 = 20
Branch analysis from position: 15
Branch analysis from position: 20
Branch analysis from position: 20
filename:       /in/GARZb
function name:  (null)
number of ops:  52
compiled vars:  !0 = $arr, !1 = $fp, !2 = $w, !3 = $i, !4 = $s, !5 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
          1        INIT_FCALL                                               'fopen'
          2        SEND_VAL                                                 '%2Fusr%2Fshare%2Fdict%2Fwords'
          3        SEND_VAL                                                 'r'
          4        DO_ICALL                                         $7      
          5        ASSIGN                                                   !1, $7
          6      > JMP                                                      ->13
          7    >   INIT_FCALL                                               'trim'
          8        SEND_VAR                                                 !2
          9        DO_ICALL                                         $9      
         10        PRE_INC                                          ~11     !3
         11        ASSIGN_DIM                                               !0, $9
         12        OP_DATA                                                  ~11
         13    >   IS_SMALLER                                       ~12     !3, 5000
         14      > JMPZ_EX                                          ~12     ~12, ->20
         15    >   INIT_FCALL                                               'fgets'
         16        SEND_VAR                                                 !1
         17        DO_ICALL                                         $13     
         18        ASSIGN                                           ~14     !2, $13
         19        BOOL                                             ~12     ~14
         20    > > JMPNZ                                                    ~12, ->7
         21    >   INIT_FCALL                                               'microtime'
         22        SEND_VAL                                                 1
         23        DO_ICALL                                         $15     
         24        ASSIGN                                                   !4, $15
         25        ASSIGN                                                   !3, 0
         26      > JMP                                                      ->30
         27    >   ISSET_ISEMPTY_DIM_OBJ                         0  ~18     !0, 'abracadabra'
         28        FREE                                                     ~18
         29        PRE_INC                                                  !3
         30    >   IS_SMALLER                                               !3, 100000
         31      > JMPNZ                                                    ~20, ->27
         32    >   INIT_FCALL                                               'microtime'
         33        SEND_VAL                                                 1
         34        DO_ICALL                                         $21     
         35        ASSIGN                                                   !5, $21
         36        SUB                                              ~23     !5, !4
         37        CONCAT                                           ~24     'Isset%3A+', ~23
         38        CONCAT                                           ~25     ~24, '%0A'
         39        ECHO                                                     ~25
         40        INIT_FCALL                                               'microtime'
         41        SEND_VAL                                                 1
         42        DO_ICALL                                         $26     
         43        ASSIGN                                                   !4, $26
         44        ASSIGN                                                   !3, 0
         45      > JMP                                                      ->49
         46    >   ARRAY_KEY_EXISTS                                 ~29     'abracadabra', !0
         47        FREE                                                     ~29
         48        PRE_INC                                                  !3
         49    >   IS_SMALLER                                               !3, 100000
         50      > JMPNZ                                                    ~31, ->46
         51    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.48 ms | 1392 KiB | 21 Q