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); ksort($array1); ksort($array2); $matched = array_intersect_key($array1, $array2); print_r((!empty($matched) ? 'matched' : 'nope'));
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 23, Position 2 = 25
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 26
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5jddb
function name:  (null)
number of ops:  29
compiled vars:  !0 = $array1, !1 = $array2, !2 = $matched
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   INIT_FCALL                                               'populate'
          1        SEND_VAL                                                 40000
          2        DO_FCALL                                      0  $3      
          3        ASSIGN                                                   !0, $3
   25     4        INIT_FCALL                                               'populate'
          5        SEND_VAL                                                 40000
          6        DO_FCALL                                      0  $5      
          7        ASSIGN                                                   !1, $5
   27     8        INIT_FCALL                                               'ksort'
          9        SEND_REF                                                 !0
         10        DO_ICALL                                                 
   28    11        INIT_FCALL                                               'ksort'
         12        SEND_REF                                                 !1
         13        DO_ICALL                                                 
   30    14        INIT_FCALL                                               'array_intersect_key'
         15        SEND_VAR                                                 !0
         16        SEND_VAR                                                 !1
         17        DO_ICALL                                         $9      
         18        ASSIGN                                                   !2, $9
   33    19        INIT_FCALL                                               'print_r'
         20        ISSET_ISEMPTY_CV                                 ~11     !2
         21        BOOL_NOT                                         ~12     ~11
         22      > JMPZ                                                     ~12, ->25
         23    >   QM_ASSIGN                                        ~13     'matched'
         24      > JMP                                                      ->26
         25    >   QM_ASSIGN                                        ~13     'nope'
         26    >   SEND_VAL                                                 ~13
         27        DO_ICALL                                                 
         28      > 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/5jddb
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/5jddb
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.96 ms | 1407 KiB | 26 Q