3v4l.org

run code in 300+ PHP versions simultaneously
<?php $c = array_combine(range(0, 10000), range(0, 10000)); $a = microtime(); for($i = 0; $i < 10000; $i++) { array_key_exists(rand(0, 10000), $c); } $b = microtime(); echo $b - $a; $t = array_combine(range(0, 10000), range(0, 10000)); $d = microtime(); for($i = 0; $i < 10000; $i++) { isset($t[rand(0, 10000)]); } $e = microtime(); echo $e - $d;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 25
Branch analysis from position: 25
2 jumps found. (Code = 44) Position 1 = 27, Position 2 = 18
Branch analysis from position: 27
1 jumps found. (Code = 42) Position 1 = 57
Branch analysis from position: 57
2 jumps found. (Code = 44) Position 1 = 59, Position 2 = 50
Branch analysis from position: 59
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 50
2 jumps found. (Code = 44) Position 1 = 59, Position 2 = 50
Branch analysis from position: 59
Branch analysis from position: 50
Branch analysis from position: 18
2 jumps found. (Code = 44) Position 1 = 27, Position 2 = 18
Branch analysis from position: 27
Branch analysis from position: 18
filename:       /in/JFpup
function name:  (null)
number of ops:  65
compiled vars:  !0 = $c, !1 = $a, !2 = $i, !3 = $b, !4 = $t, !5 = $d, !6 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'array_combine'
          1        INIT_FCALL                                               'range'
          2        SEND_VAL                                                 0
          3        SEND_VAL                                                 10000
          4        DO_ICALL                                         $7      
          5        SEND_VAR                                                 $7
          6        INIT_FCALL                                               'range'
          7        SEND_VAL                                                 0
          8        SEND_VAL                                                 10000
          9        DO_ICALL                                         $8      
         10        SEND_VAR                                                 $8
         11        DO_ICALL                                         $9      
         12        ASSIGN                                                   !0, $9
    5    13        INIT_FCALL                                               'microtime'
         14        DO_ICALL                                         $11     
         15        ASSIGN                                                   !1, $11
    8    16        ASSIGN                                                   !2, 0
         17      > JMP                                                      ->25
   10    18    >   INIT_FCALL                                               'rand'
         19        SEND_VAL                                                 0
         20        SEND_VAL                                                 10000
         21        DO_ICALL                                         $14     
         22        ARRAY_KEY_EXISTS                                 ~15     $14, !0
         23        FREE                                                     ~15
    8    24        PRE_INC                                                  !2
         25    >   IS_SMALLER                                               !2, 10000
         26      > JMPNZ                                                    ~17, ->18
   13    27    >   INIT_FCALL                                               'microtime'
         28        DO_ICALL                                         $18     
         29        ASSIGN                                                   !3, $18
   15    30        SUB                                              ~20     !3, !1
         31        ECHO                                                     ~20
   17    32        INIT_FCALL                                               'array_combine'
         33        INIT_FCALL                                               'range'
         34        SEND_VAL                                                 0
         35        SEND_VAL                                                 10000
         36        DO_ICALL                                         $21     
         37        SEND_VAR                                                 $21
         38        INIT_FCALL                                               'range'
         39        SEND_VAL                                                 0
         40        SEND_VAL                                                 10000
         41        DO_ICALL                                         $22     
         42        SEND_VAR                                                 $22
         43        DO_ICALL                                         $23     
         44        ASSIGN                                                   !4, $23
   19    45        INIT_FCALL                                               'microtime'
         46        DO_ICALL                                         $25     
         47        ASSIGN                                                   !5, $25
   22    48        ASSIGN                                                   !2, 0
         49      > JMP                                                      ->57
   24    50    >   INIT_FCALL                                               'rand'
         51        SEND_VAL                                                 0
         52        SEND_VAL                                                 10000
         53        DO_ICALL                                         $28     
         54        ISSET_ISEMPTY_DIM_OBJ                         0  ~29     !4, $28
         55        FREE                                                     ~29
   22    56        PRE_INC                                                  !2
         57    >   IS_SMALLER                                               !2, 10000
         58      > JMPNZ                                                    ~31, ->50
   27    59    >   INIT_FCALL                                               'microtime'
         60        DO_ICALL                                         $32     
         61        ASSIGN                                                   !6, $32
   29    62        SUB                                              ~34     !6, !5
         63        ECHO                                                     ~34
         64      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.38 ms | 1400 KiB | 21 Q