3v4l.org

run code in 300+ PHP versions simultaneously
<?php $list_ar = array(); for($x = 0;$x < 500; $x++){ $val = generateRandomString(20); if(!in_array($val,$list_ar)){ echo $x.'=='.$val.'<br>'; array_push($list_ar,$val); } else { echo $x.'== IN ARRAY<br>'; } } function generateRandomString($length){ $characterlist = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ123456789'; $characterlist_array = str_split($characterlist); $id = ''; for($a = 0;$a<$length;$a++){ shuffle($characterlist_array); $position = array_rand($characterlist_array, 1); $id .= $characterlist_array[$position]; } return $id; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 25
Branch analysis from position: 25
2 jumps found. (Code = 44) Position 1 = 27, Position 2 = 3
Branch analysis from position: 27
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 22
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
2 jumps found. (Code = 44) Position 1 = 27, Position 2 = 3
Branch analysis from position: 27
Branch analysis from position: 3
Branch analysis from position: 22
2 jumps found. (Code = 44) Position 1 = 27, Position 2 = 3
Branch analysis from position: 27
Branch analysis from position: 3
filename:       /in/JXvrg
function name:  (null)
number of ops:  28
compiled vars:  !0 = $list_ar, !1 = $x, !2 = $val
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    3     1        ASSIGN                                                   !1, 0
          2      > JMP                                                      ->25
    4     3    >   INIT_FCALL_BY_NAME                                       'generateRandomString'
          4        SEND_VAL_EX                                              20
          5        DO_FCALL                                      0  $5      
          6        ASSIGN                                                   !2, $5
    5     7        INIT_FCALL                                               'in_array'
          8        SEND_VAR                                                 !2
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                         $7      
         11        BOOL_NOT                                         ~8      $7
         12      > JMPZ                                                     ~8, ->22
    6    13    >   CONCAT                                           ~9      !1, '%3D%3D'
         14        CONCAT                                           ~10     ~9, !2
         15        CONCAT                                           ~11     ~10, '%3Cbr%3E'
         16        ECHO                                                     ~11
    7    17        INIT_FCALL                                               'array_push'
         18        SEND_REF                                                 !0
         19        SEND_VAR                                                 !2
         20        DO_ICALL                                                 
         21      > JMP                                                      ->24
    9    22    >   CONCAT                                           ~13     !1, '%3D%3D+IN+ARRAY%3Cbr%3E'
         23        ECHO                                                     ~13
    3    24    >   PRE_INC                                                  !1
         25    >   IS_SMALLER                                               !1, 500
         26      > JMPNZ                                                    ~15, ->3
   23    27    > > RETURN                                                   1

Function generaterandomstring:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
2 jumps found. (Code = 44) Position 1 = 22, Position 2 = 9
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
2 jumps found. (Code = 44) Position 1 = 22, Position 2 = 9
Branch analysis from position: 22
Branch analysis from position: 9
filename:       /in/JXvrg
function name:  generateRandomString
number of ops:  24
compiled vars:  !0 = $length, !1 = $characterlist, !2 = $characterlist_array, !3 = $id, !4 = $a, !5 = $position
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
   14     1        ASSIGN                                                   !1, 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ123456789'
   15     2        INIT_FCALL                                               'str_split'
          3        SEND_VAR                                                 !1
          4        DO_ICALL                                         $7      
          5        ASSIGN                                                   !2, $7
   16     6        ASSIGN                                                   !3, ''
   17     7        ASSIGN                                                   !4, 0
          8      > JMP                                                      ->20
   18     9    >   INIT_FCALL                                               'shuffle'
         10        SEND_REF                                                 !2
         11        DO_ICALL                                                 
   19    12        INIT_FCALL                                               'array_rand'
         13        SEND_VAR                                                 !2
         14        SEND_VAL                                                 1
         15        DO_ICALL                                         $12     
         16        ASSIGN                                                   !5, $12
   20    17        FETCH_DIM_R                                      ~14     !2, !5
         18        ASSIGN_OP                                     8          !3, ~14
   17    19        PRE_INC                                                  !4
         20    >   IS_SMALLER                                               !4, !0
         21      > JMPNZ                                                    ~17, ->9
   22    22    > > RETURN                                                   !3
   23    23*     > RETURN                                                   null

End of function generaterandomstring

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.59 ms | 1400 KiB | 23 Q