3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = array(); for($i=0;$i<=1000;$i++) { $a[$i] = rand(10,1000); } $foo = 0; for($i=0;$i<10000;$i++){ if (array_key_exists(rand(0,1000), $a)) { $foo++; } } echo $foo;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
2 jumps found. (Code = 44) Position 1 = 12, Position 2 = 3
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
2 jumps found. (Code = 44) Position 1 = 25, Position 2 = 15
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
2 jumps found. (Code = 43) Position 1 = 21, Position 2 = 22
Branch analysis from position: 21
2 jumps found. (Code = 44) Position 1 = 25, Position 2 = 15
Branch analysis from position: 25
Branch analysis from position: 15
Branch analysis from position: 22
Branch analysis from position: 3
2 jumps found. (Code = 44) Position 1 = 12, Position 2 = 3
Branch analysis from position: 12
Branch analysis from position: 3
filename:       /in/N6Blc
function name:  (null)
number of ops:  27
compiled vars:  !0 = $a, !1 = $i, !2 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, 0
          2      > JMP                                                      ->10
    5     3    >   INIT_FCALL                                               'rand'
          4        SEND_VAL                                                 10
          5        SEND_VAL                                                 1000
          6        DO_ICALL                                         $6      
          7        ASSIGN_DIM                                               !0, !1
          8        OP_DATA                                                  $6
    4     9        PRE_INC                                                  !1
         10    >   IS_SMALLER_OR_EQUAL                                      !1, 1000
         11      > JMPNZ                                                    ~8, ->3
    8    12    >   ASSIGN                                                   !2, 0
    9    13        ASSIGN                                                   !1, 0
         14      > JMP                                                      ->23
   10    15    >   INIT_FCALL                                               'rand'
         16        SEND_VAL                                                 0
         17        SEND_VAL                                                 1000
         18        DO_ICALL                                         $11     
         19        ARRAY_KEY_EXISTS                                         $11, !0
         20      > JMPZ                                                     ~12, ->22
   11    21    >   PRE_INC                                                  !2
    9    22    >   PRE_INC                                                  !1
         23    >   IS_SMALLER                                               !1, 10000
         24      > JMPNZ                                                    ~15, ->15
   14    25    >   ECHO                                                     !2
         26      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.11 ms | 1396 KiB | 15 Q