3v4l.org

run code in 300+ PHP versions simultaneously
<?php function genRand($length = 10, $chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ') { $randomString = ''; for ($i = 0; $i < $length; $i++) { $randomString .= $chars[rand(0, strlen($chars) - 1)]; } return $randomString; } function populate($count = 10000) { $array = array(); for($i = 0; $i < $count; $i++) { $phone = genRand(10,'0123456789'); $array[$phone] = array( 'phone' => $phone, 'name' => genRand(20), 'age' => genRand(2, '0123456789'), ); } return $array; } $array1 = populate(40000); $array2 = populate(40000); $match = FALSE; foreach($array1 as $key => $value) { if(array_key_exists($key, $array2)) { $match = TRUE; break; } } print_r(($match ? 'matched' : 'nope'));
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 10, Position 2 = 17
Branch analysis from position: 10
2 jumps found. (Code = 78) Position 1 = 11, Position 2 = 17
Branch analysis from position: 11
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 16
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
2 jumps found. (Code = 43) Position 1 = 20, Position 2 = 22
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
Branch analysis from position: 17
Branch analysis from position: 17
filename:       /in/dRsAh
function name:  (null)
number of ops:  26
compiled vars:  !0 = $array1, !1 = $array2, !2 = $match, !3 = $value, !4 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   INIT_FCALL                                               'populate'
          1        SEND_VAL                                                 40000
          2        DO_FCALL                                      0  $5      
          3        ASSIGN                                                   !0, $5
   25     4        INIT_FCALL                                               'populate'
          5        SEND_VAL                                                 40000
          6        DO_FCALL                                      0  $7      
          7        ASSIGN                                                   !1, $7
   27     8        ASSIGN                                                   !2, <false>
   29     9      > FE_RESET_R                                       $10     !0, ->17
         10    > > FE_FETCH_R                                       ~11     $10, !3, ->17
         11    >   ASSIGN                                                   !4, ~11
   30    12        ARRAY_KEY_EXISTS                                         !4, !1
         13      > JMPZ                                                     ~13, ->16
   31    14    >   ASSIGN                                                   !2, <true>
   32    15      > JMP                                                      ->17
   29    16    > > JMP                                                      ->10
         17    >   FE_FREE                                                  $10
   36    18        INIT_FCALL                                               'print_r'
         19      > JMPZ                                                     !2, ->22
         20    >   QM_ASSIGN                                        ~15     'matched'
         21      > JMP                                                      ->23
         22    >   QM_ASSIGN                                        ~15     'nope'
         23    >   SEND_VAL                                                 ~15
         24        DO_ICALL                                                 
         25      > RETURN                                                   1

Function genrand:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
2 jumps found. (Code = 44) Position 1 = 16, Position 2 = 5
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
2 jumps found. (Code = 44) Position 1 = 16, Position 2 = 5
Branch analysis from position: 16
Branch analysis from position: 5
filename:       /in/dRsAh
function name:  genRand
number of ops:  18
compiled vars:  !0 = $length, !1 = $chars, !2 = $randomString, !3 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV_INIT                                        !0      10
          1        RECV_INIT                                        !1      '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
    4     2        ASSIGN                                                   !2, ''
    5     3        ASSIGN                                                   !3, 0
          4      > JMP                                                      ->14
    6     5    >   INIT_FCALL                                               'rand'
          6        SEND_VAL                                                 0
          7        STRLEN                                           ~6      !1
          8        SUB                                              ~7      ~6, 1
          9        SEND_VAL                                                 ~7
         10        DO_ICALL                                         $8      
         11        FETCH_DIM_R                                      ~9      !1, $8
         12        ASSIGN_OP                                     8          !2, ~9
    5    13        PRE_INC                                                  !3
         14    >   IS_SMALLER                                               !3, !0
         15      > JMPNZ                                                    ~12, ->5
    8    16    > > RETURN                                                   !2
    9    17*     > RETURN                                                   null

End of function genrand

Function populate:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
2 jumps found. (Code = 44) Position 1 = 24, Position 2 = 4
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
2 jumps found. (Code = 44) Position 1 = 24, Position 2 = 4
Branch analysis from position: 24
Branch analysis from position: 4
filename:       /in/dRsAh
function name:  populate
number of ops:  26
compiled vars:  !0 = $count, !1 = $array, !2 = $i, !3 = $phone
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV_INIT                                        !0      10000
   12     1        ASSIGN                                                   !1, <array>
   13     2        ASSIGN                                                   !2, 0
          3      > JMP                                                      ->22
   14     4    >   INIT_FCALL                                               'genrand'
          5        SEND_VAL                                                 10
          6        SEND_VAL                                                 '0123456789'
          7        DO_FCALL                                      0  $6      
          8        ASSIGN                                                   !3, $6
   16     9        INIT_ARRAY                                       ~9      !3, 'phone'
   17    10        INIT_FCALL                                               'genrand'
         11        SEND_VAL                                                 20
         12        DO_FCALL                                      0  $10     
         13        ADD_ARRAY_ELEMENT                                ~9      $10, 'name'
   18    14        INIT_FCALL                                               'genrand'
         15        SEND_VAL                                                 2
         16        SEND_VAL                                                 '0123456789'
         17        DO_FCALL                                      0  $11     
         18        ADD_ARRAY_ELEMENT                                ~9      $11, 'age'
   15    19        ASSIGN_DIM                                               !1, !3
   18    20        OP_DATA                                                  ~9
   13    21        PRE_INC                                                  !2
         22    >   IS_SMALLER                                               !2, !0
         23      > JMPNZ                                                    ~13, ->4
   21    24    > > RETURN                                                   !1
   22    25*     > RETURN                                                   null

End of function populate

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.97 ms | 1407 KiB | 22 Q