3v4l.org

run code in 300+ PHP versions simultaneously
<?php $n = 1000000; // Create test array $i = 0; $array = array(); while($i < $n) { $array[$i++] = true; } $time_start = microtime(true); $i = 0; while ($i < $n) { $devnull = array_key_exists($i++, $array); } $time_end = microtime(true); $time_while1= $time_end-$time_start; echo number_format($time_while1, 3, '.', '') ." seconds - array_key_exists(array,i) on full array \n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
2 jumps found. (Code = 44) Position 1 = 9, Position 2 = 4
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 15
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 15
Branch analysis from position: 20
Branch analysis from position: 15
Branch analysis from position: 4
2 jumps found. (Code = 44) Position 1 = 9, Position 2 = 4
Branch analysis from position: 9
Branch analysis from position: 4
filename:       /in/BEOGf
function name:  (null)
number of ops:  35
compiled vars:  !0 = $n, !1 = $i, !2 = $array, !3 = $time_start, !4 = $devnull, !5 = $time_end, !6 = $time_while1
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 1000000
    6     1        ASSIGN                                                   !1, 0
    7     2        ASSIGN                                                   !2, <array>
    8     3      > JMP                                                      ->7
    9     4    >   POST_INC                                         ~10     !1
          5        ASSIGN_DIM                                               !2, ~10
          6        OP_DATA                                                  <true>
    8     7    >   IS_SMALLER                                               !1, !0
          8      > JMPNZ                                                    ~12, ->4
   12     9    >   INIT_FCALL                                               'microtime'
         10        SEND_VAL                                                 <true>
         11        DO_ICALL                                         $13     
         12        ASSIGN                                                   !3, $13
   13    13        ASSIGN                                                   !1, 0
   15    14      > JMP                                                      ->18
   16    15    >   POST_INC                                         ~16     !1
         16        ARRAY_KEY_EXISTS                                 ~17     ~16, !2
         17        ASSIGN                                                   !4, ~17
   15    18    >   IS_SMALLER                                               !1, !0
         19      > JMPNZ                                                    ~19, ->15
   19    20    >   INIT_FCALL                                               'microtime'
         21        SEND_VAL                                                 <true>
         22        DO_ICALL                                         $20     
         23        ASSIGN                                                   !5, $20
   20    24        SUB                                              ~22     !5, !3
         25        ASSIGN                                                   !6, ~22
   21    26        INIT_FCALL                                               'number_format'
         27        SEND_VAR                                                 !6
         28        SEND_VAL                                                 3
         29        SEND_VAL                                                 '.'
         30        SEND_VAL                                                 ''
         31        DO_ICALL                                         $24     
   22    32        CONCAT                                           ~25     $24, '+seconds+-+array_key_exists%28array%2Ci%29+on+full+array+%0A'
         33        ECHO                                                     ~25
         34      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
139.75 ms | 1401 KiB | 17 Q