3v4l.org

run code in 300+ PHP versions simultaneously
<?php $total = 10000; $paragraph = 'this is a sentence. Crud! $$$$!'; $words = explode(' ', $paragraph); $badWordHash = [ '$$$$' => true, '@#$%' => true, 'crud' => true, 'fud' => true, 'fudd' => true, 'dud' => true ]; $s = microtime(true); for ($j = 0; $j < $total; $j++) { foreach ($words as $word) { isset($badWordHash[strtolower($word)]); } } echo "isset: " . (microtime(true) - $s) . "\n"; $s = microtime(true); for ($j = 0; $j < $total; $j++) { foreach ($words as $word) { array_key_exists(strtolower($word), $badWordHash); } } echo "array_key_exists: " . (microtime(true) - $s) . "\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
2 jumps found. (Code = 44) Position 1 = 26, Position 2 = 14
Branch analysis from position: 26
1 jumps found. (Code = 42) Position 1 = 49
Branch analysis from position: 49
2 jumps found. (Code = 44) Position 1 = 51, Position 2 = 39
Branch analysis from position: 51
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 39
2 jumps found. (Code = 77) Position 1 = 40, Position 2 = 47
Branch analysis from position: 40
2 jumps found. (Code = 78) Position 1 = 41, Position 2 = 47
Branch analysis from position: 41
1 jumps found. (Code = 42) Position 1 = 40
Branch analysis from position: 40
Branch analysis from position: 47
2 jumps found. (Code = 44) Position 1 = 51, Position 2 = 39
Branch analysis from position: 51
Branch analysis from position: 39
Branch analysis from position: 47
Branch analysis from position: 14
2 jumps found. (Code = 77) Position 1 = 15, Position 2 = 22
Branch analysis from position: 15
2 jumps found. (Code = 78) Position 1 = 16, Position 2 = 22
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
Branch analysis from position: 22
2 jumps found. (Code = 44) Position 1 = 26, Position 2 = 14
Branch analysis from position: 26
Branch analysis from position: 14
Branch analysis from position: 22
filename:       /in/vfRfB
function name:  (null)
number of ops:  59
compiled vars:  !0 = $total, !1 = $paragraph, !2 = $words, !3 = $badWordHash, !4 = $s, !5 = $j, !6 = $word
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, 10000
    5     1        ASSIGN                                                   !1, 'this+is+a+sentence.+Crud%21+%24%24%24%24%21'
    6     2        INIT_FCALL                                               'explode'
          3        SEND_VAL                                                 '+'
          4        SEND_VAR                                                 !1
          5        DO_ICALL                                         $9      
          6        ASSIGN                                                   !2, $9
    8     7        ASSIGN                                                   !3, <array>
   17     8        INIT_FCALL                                               'microtime'
          9        SEND_VAL                                                 <true>
         10        DO_ICALL                                         $12     
         11        ASSIGN                                                   !4, $12
   18    12        ASSIGN                                                   !5, 0
         13      > JMP                                                      ->24
   19    14    > > FE_RESET_R                                       $15     !2, ->22
         15    > > FE_FETCH_R                                               $15, !6, ->22
   20    16    >   INIT_FCALL                                               'strtolower'
         17        SEND_VAR                                                 !6
         18        DO_ICALL                                         $16     
         19        ISSET_ISEMPTY_DIM_OBJ                         0  ~17     !3, $16
         20        FREE                                                     ~17
   19    21      > JMP                                                      ->15
         22    >   FE_FREE                                                  $15
   18    23        PRE_INC                                                  !5
         24    >   IS_SMALLER                                               !5, !0
         25      > JMPNZ                                                    ~19, ->14
   24    26    >   INIT_FCALL                                               'microtime'
         27        SEND_VAL                                                 <true>
         28        DO_ICALL                                         $20     
         29        SUB                                              ~21     $20, !4
         30        CONCAT                                           ~22     'isset%3A+++++', ~21
         31        CONCAT                                           ~23     ~22, '%0A'
         32        ECHO                                                     ~23
   26    33        INIT_FCALL                                               'microtime'
         34        SEND_VAL                                                 <true>
         35        DO_ICALL                                         $24     
         36        ASSIGN                                                   !4, $24
   27    37        ASSIGN                                                   !5, 0
         38      > JMP                                                      ->49
   28    39    > > FE_RESET_R                                       $27     !2, ->47
         40    > > FE_FETCH_R                                               $27, !6, ->47
   29    41    >   INIT_FCALL                                               'strtolower'
         42        SEND_VAR                                                 !6
         43        DO_ICALL                                         $28     
         44        ARRAY_KEY_EXISTS                                 ~29     $28, !3
         45        FREE                                                     ~29
   28    46      > JMP                                                      ->40
         47    >   FE_FREE                                                  $27
   27    48        PRE_INC                                                  !5
         49    >   IS_SMALLER                                               !5, !0
         50      > JMPNZ                                                    ~31, ->39
   33    51    >   INIT_FCALL                                               'microtime'
         52        SEND_VAL                                                 <true>
         53        DO_ICALL                                         $32     
         54        SUB                                              ~33     $32, !4
         55        CONCAT                                           ~34     'array_key_exists%3A+++++', ~33
         56        CONCAT                                           ~35     ~34, '%0A'
         57        ECHO                                                     ~35
         58      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.98 ms | 1400 KiB | 19 Q