3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function GeneratePassword ($length,$chars) { $res = array(); $char_length = strlen($chars) -1 ; for($i = 0; $i < $length; $i++) { $res[] = $chars[rand(0,$char_length)]; } return implode('', $res); } echo GeneratePassword(10, 'asdafdfgsaffhdhsd');
Output for 7.1.0
fdashahfhd
Output for 7.0.14
addashahad
Output for 7.0.10
daffaddfaa
Output for 7.0.9
asfaadssfd
Output for 7.0.8
dsfssshsdd
Output for 7.0.7
hsfdhshafa
Output for 7.0.6
ffhfddashf
Output for 7.0.5
fshafahddg
Output for 7.0.4
fdhsadgdfd
Output for 7.0.3
ddfsfsgdfa
Output for 7.0.2
fshagfdgad
Output for 7.0.1
dfhasddddd
Output for 7.0.0
gddhssdash
Output for hhvm-3.12.0
ahsfdsfahf
Output for hhvm-3.10.0
gfhdhsdhds
Output for 5.6.28
sdddddfhdd
Output for 5.6.25
ddafdgsfhd
Output for 5.6.24
adfafdfhsd
Output for 5.6.23
ahgdffdhad
Output for 5.6.22
fhfdssfdgd
Output for 5.6.21
saafdaadfh
Output for 5.6.20
fhffhffgad
Output for 5.6.19
fagaffhada
Output for 5.6.18
daddshfhdf
Output for 5.6.17
aadfhffaaf
Output for 5.6.16
shfhsggssd
Output for 5.6.15
ffggafadgd
Output for 5.6.14
gasgffffdd
Output for 5.6.13
hfsffaasds
Output for 5.6.12
ghdgdafaad
Output for 5.6.11
sfggffsgdf
Output for 5.6.10
dadhadhffd
Output for 5.6.9
gfdgfaasfd
Output for 5.6.8
dsggffhfss
Output for 5.6.7
ffhdafgdsf
Output for 5.6.6
ssdfaaaadd
Output for 5.6.5
dsfffdddfd
Output for 5.6.4
hfhgshfaff
Output for 5.6.3
fgsdfdsgaa
Output for 5.6.2
ddgdsfhgsg
Output for 5.6.1
sadssdafhd
Output for 5.6.0
fhafffaafd
Output for 5.5.38
dhsdafddfa
Output for 5.5.37
ddfahhfsds
Output for 5.5.36
ahffsdhhaf
Output for 5.5.35
hdhffhshsh
Output for 5.5.34
ssahsddash
Output for 5.5.33
ddddhffasf
Output for 5.5.32
dfffsssasf
Output for 5.5.31
afafaahddh
Output for 5.5.30
dfdfdgadfg
Output for 5.5.29
fsasssgfds
Output for 5.5.28
ddhfadddff
Output for 5.5.27
gdafadadff
Output for 5.5.26
shadfggffs
Output for 5.5.25
afffafddha
Output for 5.5.24
shsssddfff
Output for 5.5.23
sdfdsadsff
Output for 5.5.22
hfadasgada
Output for 5.5.21
sssfsffasf
Output for 5.5.20
dhsshfsdhd
Output for 5.5.19
ddfhhfdadf
Output for 5.5.18
sdsfasgasd
Output for 5.5.16
hsfsgfadhf
Output for 5.5.15
fhafasfgaa
Output for 5.5.14
adfhghdssf
Output for 5.5.13
sdfdddfssf
Output for 5.5.12
faadddahfd
Output for 5.5.11
fghgdddsgf
Output for 5.5.10
ssfassafdh
Output for 5.5.9
adsddfdffs
Output for 5.5.8
fdfasadsdf
Output for 5.5.7
hfdhddfsad
Output for 5.5.6
shdhgddgdf
Output for 5.5.5
afhddfadas
Output for 5.5.4
asgfsgffgh
Output for 5.5.3
sdaaffsaga
Output for 5.5.2
dagfhsdsss
Output for 5.5.1
fdfffdffdd
Output for 5.5.0
dasfaffsad
Output for 5.4.45
afgasfafff
Output for 5.4.44
aadfdgffhs
Output for 5.4.43
afhfffhdhf
Output for 5.4.42
ssfdddadfs
Output for 5.4.41
ahfdfsddss
Output for 5.4.40
faffgdgagh
Output for 5.4.39
saddgdasds
Output for 5.4.38
ddagdfashh
Output for 5.4.37
ghdfahaasa
Output for 5.4.36
ghdgsaafdd
Output for 5.4.35
asdsssdffd
Output for 5.4.34
fdddffshhd
Output for 5.4.32
aasgfaffsf
Output for 5.4.31
assddadaff
Output for 5.4.30
fsdghgdahh
Output for 5.4.29
hgsfhdfsdd
Output for 5.4.28
ddfdgdsffh
Output for 5.4.27
hdgdffdshg
Output for 5.4.26
gssfgdafha
Output for 5.4.25
daddafddfd
Output for 5.4.24
dffaashfsf
Output for 5.4.23
dsfhdfdffa
Output for 5.4.22
fdffashfgs
Output for 5.4.21
gfaafdaddh
Output for 5.4.20
dfdsgdafsd
Output for 5.4.19
hasfashdah
Output for 5.4.18
aaddahddsf
Output for 5.4.17
hsssdfdfds
Output for 5.4.16
agadsfaadd
Output for 5.4.15
fsffsfsfad
Output for 5.4.14
ddfsdfafdf
Output for 5.4.13
dhadasdfdf
Output for 5.4.12
dsfhhfaafh
Output for 5.4.11
asdfdshgdf
Output for 5.4.10
fggsashfaf
Output for 5.4.9
gfaddasssg
Output for 5.4.8
fdddhfdfah
Output for 5.4.7
sfsffahaah
Output for 5.4.6
sdahddsfhf
Output for 5.4.5
hfdfhdafdd
Output for 5.4.4
dfgsfssghf
Output for 5.4.3
dfdhdsdagd
Output for 5.4.2
aadhdfsssh
Output for 5.4.1
dshdfgfdda
Output for 5.4.0
addaffdddd
Output for 5.3.29
fgshshdaaa
Output for 5.3.28
hfadaahsdf
Output for 5.3.27
ddahafffdh
Output for 5.3.26
ahhhafgdsh
Output for 5.3.25
sdhdfagdhf
Output for 5.3.24
sfsdasfsda
Output for 5.3.23
ddahfshasf
Output for 5.3.22
sgddhffgdd
Output for 5.3.21
dgdhdaaaad
Output for 5.3.20
ffaddshafg
Output for 5.3.19
gshhsadfaf
Output for 5.3.18
daafhfaffs
Output for 5.3.17
sgasfssfff
Output for 5.3.16
sdhffaadfd
Output for 5.3.15
ghhdssgaha
Output for 5.3.14
sdffgafdhs
Output for 5.3.13
gssddafafa
Output for 5.3.12
dddhhadshh
Output for 5.3.11
hsgddhghhs
Output for 5.3.10
sssdfhdadf
Output for 5.3.9
hafddffaff
Output for 5.3.8
ddfdhhssfs
Output for 5.3.7
dfssfadfad
Output for 5.3.6
dfhhshfssd
Output for 5.3.5
dgfffsasaa
Output for 5.3.4
hafsaadafa
Output for 5.3.3
agadasdfdf
Output for 5.3.2
ffsfaafasd
Output for 5.3.1
fdffafsfdd
Output for 5.3.0
daddhdfdff
Output for 5.2.17
hdhsdffadd
Output for 5.2.16
afaddddfhg
Output for 5.2.15
sassdshhsg
Output for 5.2.14
dddagadgfs
Output for 5.2.13
fhhhghhahg
Output for 5.2.12
dsddhsfdah
Output for 5.2.11
dddshfsfhf
Output for 5.2.10
dfagsddfaa
Output for 5.2.9
fffdahshsf
Output for 5.2.8
ghfdfdshdg
Output for 5.2.7
hdahfshfdf
Output for 5.2.6
sfhahdafss
Output for 5.2.5
fffadfshsa
Output for 5.2.4
gffgdddfas
Output for 5.2.3
ffhdssdadf
Output for 5.2.2
sfddhhahaa
Output for 5.2.1
sggadddhdh
Output for 5.2.0
dfffadaddf
Output for 5.1.6
adfaddddad
Output for 5.1.5
fsshhfdhgf
Output for 5.1.4
hsgsssfffs
Output for 5.1.3
hhfdddhasf
Output for 5.1.2
ahsdhdfsdd
Output for 5.1.1
ddfhdadfff
Output for 5.1.0
faadfdshfs
Output for 5.0.5
ffasfshddd
Output for 5.0.4
ahssffdfas
Output for 5.0.3
hfaaadfaaa
Output for 5.0.2
ffgsaafaad
Output for 5.0.1
sffaadddfd
Output for 5.0.0
safdfasddd
Output for 4.4.9
sfadhffdsa
Output for 4.4.8
fafsgaasaa
Output for 4.4.7
aafadddfda
Output for 4.4.6
dssasagfad
Output for 4.4.5
dfsdaahdgh
Output for 4.4.4
assdahadag
Output for 4.4.3
dfhfffgssh
Output for 4.4.2
fdhddfdhdd
Output for 4.4.1
dhhfsdadaa
Output for 4.4.0
ssdaahhffa
Output for 4.3.11
hddfasfafa
Output for 4.3.10
dahggfsdah
Output for 4.3.9
ddffhsaaga
Output for 4.3.8
ddasshdddh
Output for 4.3.7
dadhhsfdhs
Output for 4.3.6
sgdddfhadf
Output for 4.3.5
ssdafdgshd
Output for 4.3.4
addhdfghsf
Output for 4.3.3
fsdsdadadg
Output for 4.3.2
ffsfaddffd
Output for 4.3.1
dsdhssffsf
Output for 4.3.0
agasddgdfs