3v4l.org

run code in 300+ PHP versions simultaneously
<?php $n = 1000000; // First a test with a empty array $array = array(); $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 empty array \n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
2 jumps found. (Code = 44) Position 1 = 13, Position 2 = 8
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
2 jumps found. (Code = 44) Position 1 = 13, Position 2 = 8
Branch analysis from position: 13
Branch analysis from position: 8
filename:       /in/2cvVh
function name:  (null)
number of ops:  28
compiled vars:  !0 = $n, !1 = $array, !2 = $time_start, !3 = $i, !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, <array>
    8     2        INIT_FCALL                                               'microtime'
          3        SEND_VAL                                                 <true>
          4        DO_ICALL                                         $9      
          5        ASSIGN                                                   !2, $9
    9     6        ASSIGN                                                   !3, 0
   11     7      > JMP                                                      ->11
   12     8    >   PRE_INC                                          ~12     !3
          9        ARRAY_KEY_EXISTS                                 ~13     ~12, !1
         10        ASSIGN                                                   !4, ~13
   11    11    >   IS_SMALLER                                               !3, !0
         12      > JMPNZ                                                    ~15, ->8
   15    13    >   INIT_FCALL                                               'microtime'
         14        SEND_VAL                                                 <true>
         15        DO_ICALL                                         $16     
         16        ASSIGN                                                   !5, $16
   16    17        SUB                                              ~18     !5, !2
         18        ASSIGN                                                   !6, ~18
   17    19        INIT_FCALL                                               'number_format'
         20        SEND_VAR                                                 !6
         21        SEND_VAL                                                 3
         22        SEND_VAL                                                 '.'
         23        SEND_VAL                                                 ''
         24        DO_ICALL                                         $20     
   18    25        CONCAT                                           ~21     $20, '+seconds+-+array_key_exists%28array%2Ci%29+on+empty+array+%0A'
         26        ECHO                                                     ~21
         27      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
140.2 ms | 1396 KiB | 17 Q