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(20000); $array2 = array(40000); $match = FALSE; foreach($array1 as $key => $value) { if(isset($array2[$key])) { $match = TRUE; break; } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 14
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 14
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 13
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 14
Branch analysis from position: 14
filename:       /in/et2p2
function name:  (null)
number of ops:  16
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                                                 20000
          2        DO_FCALL                                      0  $5      
          3        ASSIGN                                                   !0, $5
   25     4        ASSIGN                                                   !1, <array>
   27     5        ASSIGN                                                   !2, <false>
   29     6      > FE_RESET_R                                       $9      !0, ->14
          7    > > FE_FETCH_R                                       ~10     $9, !3, ->14
          8    >   ASSIGN                                                   !4, ~10
   30     9        ISSET_ISEMPTY_DIM_OBJ                         0          !1, !4
         10      > JMPZ                                                     ~12, ->13
   31    11    >   ASSIGN                                                   !2, <true>
   32    12      > JMP                                                      ->14
   29    13    > > JMP                                                      ->7
         14    >   FE_FREE                                                  $9
   34    15      > 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/et2p2
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/et2p2
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:
145.73 ms | 1403 KiB | 19 Q