3v4l.org

run code in 300+ PHP versions simultaneously
<?php $keyword = array_fill(1, 232, 'system'); $start = microtime(true); for ($i = 0; $i < 50000; $i++) { in_array('user', $keyword, true); } $end = microtime(true); echo 'In Array: ' . ($end - $start); echo "\r\n"; $start = microtime(true); for ($i = 0; $i < 50000; $i++) { isset($keyword['user']); } $end = microtime(true); echo 'Isset: ' . ($end - $start);
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 = 12
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 37
Branch analysis from position: 37
2 jumps found. (Code = 44) Position 1 = 39, Position 2 = 34
Branch analysis from position: 39
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 34
2 jumps found. (Code = 44) Position 1 = 39, Position 2 = 34
Branch analysis from position: 39
Branch analysis from position: 34
Branch analysis from position: 12
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 12
Branch analysis from position: 20
Branch analysis from position: 12
filename:       /in/2R4Dg
function name:  (null)
number of ops:  47
compiled vars:  !0 = $keyword, !1 = $start, !2 = $i, !3 = $end
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'array_fill'
          1        SEND_VAL                                                 1
          2        SEND_VAL                                                 232
          3        SEND_VAL                                                 'system'
          4        DO_ICALL                                         $4      
          5        ASSIGN                                                   !0, $4
    5     6        INIT_FCALL                                               'microtime'
          7        SEND_VAL                                                 <true>
          8        DO_ICALL                                         $6      
          9        ASSIGN                                                   !1, $6
    6    10        ASSIGN                                                   !2, 0
         11      > JMP                                                      ->18
    7    12    >   INIT_FCALL                                               'in_array'
         13        SEND_VAL                                                 'user'
         14        SEND_VAR                                                 !0
         15        SEND_VAL                                                 <true>
         16        DO_ICALL                                                 
    6    17        PRE_INC                                                  !2
         18    >   IS_SMALLER                                               !2, 50000
         19      > JMPNZ                                                    ~11, ->12
    9    20    >   INIT_FCALL                                               'microtime'
         21        SEND_VAL                                                 <true>
         22        DO_ICALL                                         $12     
         23        ASSIGN                                                   !3, $12
   10    24        SUB                                              ~14     !3, !1
         25        CONCAT                                           ~15     'In+Array%3A+', ~14
         26        ECHO                                                     ~15
   12    27        ECHO                                                     '%0D%0A'
   14    28        INIT_FCALL                                               'microtime'
         29        SEND_VAL                                                 <true>
         30        DO_ICALL                                         $16     
         31        ASSIGN                                                   !1, $16
   15    32        ASSIGN                                                   !2, 0
         33      > JMP                                                      ->37
   16    34    >   ISSET_ISEMPTY_DIM_OBJ                         0  ~19     !0, 'user'
         35        FREE                                                     ~19
   15    36        PRE_INC                                                  !2
         37    >   IS_SMALLER                                               !2, 50000
         38      > JMPNZ                                                    ~21, ->34
   18    39    >   INIT_FCALL                                               'microtime'
         40        SEND_VAL                                                 <true>
         41        DO_ICALL                                         $22     
         42        ASSIGN                                                   !3, $22
   19    43        SUB                                              ~24     !3, !1
         44        CONCAT                                           ~25     'Isset%3A+', ~24
         45        ECHO                                                     ~25
         46      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
131.51 ms | 1017 KiB | 16 Q