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
gdfdfdaasf
Output for 7.0.14
sdhfdaddag
Output for 7.0.12
fsgafdhhfa
Output for 7.0.6
ffhfhdfahs
Output for 7.0.5
fsdfshdass
Output for 7.0.4
daadhfahfh
Output for 7.0.3
gddsfadfaf
Output for 7.0.2
dfgadafaaf
Output for 7.0.1
ddffsdsdhg
Output for 7.0.0
fddagahdsg
Output for 5.6.28
fhhadsddsh
Output for 5.6.21
sgdsahddsd
Output for 5.6.20
ssffhadfah
Output for 5.6.19
fadasfgffa
Output for 5.6.18
sfhfffhdsd
Output for 5.6.17
asgdddsfad
Output for 5.6.16
agdsshfdfa
Output for 5.6.15
asdgfsfsfd
Output for 5.6.14
ffdagdaddf
Output for 5.6.13
daffhsdsda
Output for 5.6.12
sgddgffaas
Output for 5.6.11
sdaaaafssf
Output for 5.6.10
hffadfdfdf
Output for 5.6.9
sshdhahfgh
Output for 5.6.8
dddfaffdaf
Output for 5.6.7
ddasffdggf
Output for 5.5.35
adhdsfaada
Output for 5.5.34
dadfddgfgh
Output for 5.5.33
asfdfgsadd
Output for 5.5.32
hfghfasafd
Output for 5.5.31
sfhaddgass
Output for 5.5.30
fhfffshdgs
Output for 5.5.29
faddsaasff
Output for 5.5.28
faadfddffs
Output for 5.5.27
dsfsfaaadd
Output for 5.5.26
aafgfsssas
Output for 5.5.25
dgfhdhashd
Output for 5.5.24
hgdfafdggs
Output for 5.4.45
ssahdddfda
Output for 5.4.44
addghsssfa
Output for 5.4.43
fdfsddadaa
Output for 5.4.42
ddfaasdfsa
Output for 5.4.41
ddfsssadhs
Output for 5.4.40
ddasshfgaa
Output for 5.4.39
hhssfadfad
Output for 5.4.38
hfafdsadgd
Output for 5.4.37
gfdgdfhfdh
Output for 5.4.36
afhssfgddd
Output for 5.4.35
sfdssdsadf
Output for 5.4.34
dfadaddddd
Output for 5.4.32
hdfafdssaf
Output for 5.4.31
ffaafadfda
Output for 5.4.30
sfhadafssa
Output for 5.4.29
fafsfsfhda
Output for 5.4.28
fdgaaddfga
Output for 5.4.27
dsffsdhasf
Output for 5.4.26
fsfahdsfhf
Output for 5.4.25
afgdsdddfa
Output for 5.4.24
hfdddsdagd
Output for 5.4.23
haaddsfhgd
Output for 5.4.22
asffdaddaa
Output for 5.4.21
hsfdsadssa
Output for 5.4.20
fddhagdfss
Output for 5.4.19
sdfasaadsg
Output for 5.4.18
agahhaasad
Output for 5.4.17
gfssfdasfh
Output for 5.4.16
ffhdhddhdh
Output for 5.4.15
ssdsasaasd
Output for 5.4.14
dhfghassss
Output for 5.4.13
ssfdfadasf
Output for 5.4.12
sssagfasdh
Output for 5.4.11
hdsaahasfd
Output for 5.4.10
safafdddsa
Output for 5.4.9
assfahdhas
Output for 5.4.8
adahhdssaf
Output for 5.4.7
ddsdddhsda
Output for 5.4.6
dgadaaddss
Output for 5.4.5
ffahhassdf
Output for 5.4.4
faaddaffsd
Output for 5.4.3
shdddssgdf
Output for 5.4.2
hdddsdgsaa
Output for 5.4.1
dsfddgsddf
Output for 5.4.0
dfadfasagg
Output for 5.3.29
gaafaadhad
Output for 5.3.28
gdsffsdsss
Output for 5.3.27
sffdfddfff
Output for 5.3.26
fhdaddsaas
Output for 5.3.25
ffdfssdfsa
Output for 5.3.24
fdssfddhhs
Output for 5.3.23
gfffsadddd
Output for 5.3.22
fffadaafga
Output for 5.3.21
sfaffafssa
Output for 5.3.20
dsffadfdds
Output for 5.3.19
ggashdgfda
Output for 5.3.18
haffffdfgs
Output for 5.3.17
hsfasfhfag
Output for 5.3.16
sdhassfssf
Output for 5.3.15
agfdfdaddf
Output for 5.3.14
fsfadhsssf
Output for 5.3.13
haddddhafh
Output for 5.3.12
afdfasahdd
Output for 5.3.11
hfdddfdsha
Output for 5.3.10
agfsaasgaf
Output for 5.3.9
adhddfdaad
Output for 5.3.8
dssahddgaa
Output for 5.3.7
dhaaasfdfs
Output for 5.3.6
dhfaadahda
Output for 5.3.5
hagdddffhs
Output for 5.3.4
gdffdffffa
Output for 5.3.3
ffdshshfad
Output for 5.3.2
dfsssdsfas
Output for 5.3.1
adgffddfsg
Output for 5.3.0
ssfhahsgas
Output for 5.2.17
haadssgfdd
Output for 5.2.16
afagsfasff
Output for 5.2.15
dhdddasfgf
Output for 5.2.14
shahdfhggs
Output for 5.2.13
ddfdsssada
Output for 5.2.12
fffdsfsfgf
Output for 5.2.11
sffffagdad
Output for 5.2.10
dfafffhafs
Output for 5.2.9
hssfsdfddd
Output for 5.2.8
sfgdgdssha
Output for 5.2.7
afdgafhsaf
Output for 5.2.6
ashdhfhdfs
Output for 5.2.5
daffdfddda
Output for 5.2.4
gdfaddhhfd
Output for 5.2.3
sfdahfsdfd
Output for 5.2.2
dhdhshfafs
Output for 5.2.1
hfggsdssah
Output for 5.2.0
ssdfsshfsh
Output for 5.1.6
dffdsfsahf
Output for 5.1.5
hdffdfdfda
Output for 5.1.4
fhafsagfha
Output for 5.1.3
dagdaahdas
Output for 5.1.2
affsgafdah
Output for 5.1.1
ffaafsgsfs
Output for 5.1.0
hdfafafhfs
Output for 5.0.5
hfsfsafddd
Output for 5.0.4
gdsddhfsdf
Output for 5.0.3
afdasfadhd
Output for 5.0.2
shgfhffdfd
Output for 5.0.1
dadddgdghd
Output for 5.0.0
hfdagsdass
Output for 4.4.9
fdhhfdhads
Output for 4.4.8
hdaffhadgg
Output for 4.4.7
fassfaafdd
Output for 4.4.6
dadfsfdffd
Output for 4.4.5
sasdhdddhs
Output for 4.4.4
dsfdfafdff
Output for 4.4.3
shdsffgasg
Output for 4.4.2
dsffddhhsd
Output for 4.4.1
ggafghfsdd
Output for 4.4.0
sdfgdgadsd
Output for 4.3.11
sdaafaddfs
Output for 4.3.10
afhafsfdsf
Output for 4.3.9
gfsahdfhah
Output for 4.3.8
fsdfgddhhs
Output for 4.3.7
sdfsfdddhh
Output for 4.3.6
faaadaahhh
Output for 4.3.5
afhhaaffdf
Output for 4.3.4
fdhasfddhs
Output for 4.3.3
dsdfhhasdf
Output for 4.3.2
dsaddfshsh
Output for 4.3.1
ddahshahff
Output for 4.3.0
dfdfhsffds