3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function random_string($charcount = 8, $mode = 0, $capsonly = 0) { /* 0 = alphanumeric 1 = letters only 2 = numbers only */ $chars_alpha_cap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; $chars_alpha_low = 'abcdefghijklmnopqrstuvwxyz'; $chars_num = '0123456789'; if ($capsonly) { $chars_alpha_cap = ''; $chars_alpha_low = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; } switch ($mode) { case 1: $chars = $chars_alpha_cap . $chars_alpha_low; break; case 2: $chars = $chars_num; break; default: $chars = $chars_alpha_cap . $chars_alpha_low . $chars_num; } $rand = false; for ($i = 0; $i < $charcount; $i++) { $rand .= $chars[mt_rand(0, strlen($chars) - 1)]; } return $rand; } echo random_string(32,1,0);
Output for 7.1.0
ynbsFUTrYVOyTlBAUGLtZihpvZJmbxho
Output for 7.0.14
DPIHLBcZBfvxJLWzpMwXsXKlscbQfkgK
Output for 7.0.7
ZPGQHAnApaQXznAVrldUtRRRxufEeuuU
Output for 7.0.6
YtHmdVaMalKwHrxrHiQyWJHabfvMvXJV
Output for 7.0.5
oAJdYRUcoADHYukCxUAxTGXnIczYpyOu
Output for 7.0.4
DaczwPfyFaDyKnzVogJPbzgreqXdVyEe
Output for 7.0.3
ZrrUtiASiVPmaYeCIfWjuKuJbwiFrscp
Output for 7.0.2
uXKxGOBfWkXlFUqnPKnzujvpTmcTXixg
Output for 7.0.1
laBDxBJsQlRRImJtFdxJBwjLAWaPKXPG
Output for 7.0.0
dlBZBOZhCkXCFCvunvlTiYryLIWNHEce
Output for hhvm-3.12.0
GEoiViDpJBshANpqOOczRwiFQPtdFWVr
Output for hhvm-3.10.0
XfpGKFaYDjQxszJNHykcFzIDZRcTMagz
Output for 5.6.28
vFhbBFBoXVyoERdcJCZgJNmWWSbwmozi
Output for 5.6.22
WxCVmOEjvdEnSbmBmdKsfJjphxikilGm
Output for 5.6.21
viIadAYsNStOchPjwQyRfoafjsoixSDZ
Output for 5.6.20
niiXDBYEQCtTfvYAEUtgtNelYBrCnOIT
Output for 5.6.19
fEclSydMURGfWGpTpBtgdXjnZNIhvMWy
Output for 5.6.18
oslkXnnCVoowJUHCXIiMjMNBDQDFbMWS
Output for 5.6.17
puhLieGelYdCqtWujXrGdgwphfQlrNav
Output for 5.6.16
ZYxuGRTremIGSRznsGOBbbpSpjhlnZLQ
Output for 5.6.15
sUPybZvENlVswlwGecJtSuStydMBFwEB
Output for 5.6.14
AfAZIjCZzhTfmnHEmLnPPpBqVoevOgeU
Output for 5.6.13
rjJkFKDsqBJDffdkUDvGsGtuyRIpquhC
Output for 5.6.12
aevFyMnLusjYORDvjqSIwaWNgbazxgDr
Output for 5.6.11
wEOMbVLyLkKiDPnBwPrDSvdzDPcbidMA
Output for 5.6.10
ZyDQtqSezODkfNEyawQkKPSbfNmpghuE
Output for 5.6.9
sQUjGFhCmIJvasOHTZYarKisEWdIYart
Output for 5.6.8
UjihAgXtwnyikBTDdoQxqzXngQTBiPnW
Output for 5.6.7
QfcqjPUftQtBOHSBgVKKvnTZZGQhZXif
Output for 5.6.6
IFGTwwVYCBDDuuplHbvKmQhlskmDQXwf
Output for 5.6.5
dMoDqNYHdBAJpuSxapihiFecphtuNwcG
Output for 5.6.4
PWgTXtHJCdbjMEdyBqtnCyUNNIjWFRZF
Output for 5.6.3
rzsgXEpPttZddeFTtBfxIMxtMFRBCLJl
Output for 5.6.2
hQZGMkYUaBiQgDXqNQQjsfUzqFdEJiTB
Output for 5.6.1
LUnANllhsOjoKHlBvjeHOBjNykUAYRAn
Output for 5.6.0
XAYbRKOVdEfTDzTrbaRFfIUjUGAFogNu
Output for 5.5.36
WNkpJGBSrfPmXwlfASyfRKuYNVWLidHS
Output for 5.5.35
obqkjqcpUBLzuYQvRqfRZbCHHQpodUsA
Output for 5.5.34
cgDVrvQtwypIaDkChdupIyvBrigZYZQT
Output for 5.5.33
EWsUIyWArzkJBhRGvZXxxKUrhZUmfzRD
Output for 5.5.32
zCAFCkdsMhZQnFEGmNHbyeIcSZUODoRl
Output for 5.5.31
juhpDOWEOdoPBCfGxEgcEJKflASuKFtE
Output for 5.5.30
pbKHgKQgapcktGoCkMoUiDQhuWDJgJBL
Output for 5.5.29
fGitCsuXPTmgzROProvhmJvzxSwspwDN
Output for 5.5.28
UocnubizLunqVhguGdILjnZhRfwKqnMn
Output for 5.5.27
MNKXURHVmOmdgrIVTLuzwYwlIDyxFCRL
Output for 5.5.26
DBoKFJpnpuxMvBptEnnShUzeScgUrudx
Output for 5.5.25
XAdBJlmmpWNhyvJiasKOwkCMnHQcOktU
Output for 5.5.24
wSdcWySSvPqJeOjfVgIuhfmfNjXBmWFU
Output for 5.5.23
BXSsvHdeuPxEiEfXACryAXTxYiAVDSwt
Output for 5.5.22
LWbdaTguxNazdndOoPdaIrHfCNTCfJUo
Output for 5.5.21
RwSOYnFxYujztEyqtXciRrFMlxOlFMTq
Output for 5.5.20
oAWsQatxIsWzJgOjoMZpUbGjKduZDdcy
Output for 5.5.19
hnmTIkfjTMOpKoqAjBAAnOPZZrqnEipg
Output for 5.5.18
gMRLMUAfZXRBwtYAtmRqTYBMaUPRBfef
Output for 5.5.16
eBqGSNmzBGTmIbDgWckhhBIyGhZSZeia
Output for 5.5.15
bgMbnjKfmpHksDeVHQbRlJAIcxlFbgZm
Output for 5.5.14
xjFKKOnRbOaYJrdIDjprkslTozzwEarT
Output for 5.5.13
JcdEKQWKfVXgrxUZrtyYCJDTkfVskPWM
Output for 5.5.12
GiGVZMpRCAGmOgWHdxPDjjkRBtFYzwMi
Output for 5.5.11
iaFeUTFolnlxAycCaAsgAbulKqQOVnkJ
Output for 5.5.10
NZOsknLwjXxdDYJJZqLiWtjgyHcTIJau
Output for 5.5.9
GhoQHZOpUVDrbdOwLoHGbyymvDziAPru
Output for 5.5.8
egrAnaNHmbxvMQIRyxpyesEQMSXGPPbu
Output for 5.5.7
paoGlAFdlZcokgRpQvnJKbiJrPoCLVwt
Output for 5.5.6
CmMJcbzyaOvZlAnTgYyLkDWQegmFheLf
Output for 5.5.5
sCfGqrYDgxAMIMUXDWnAQyWGcCnYxWCs
Output for 5.5.4
LBxYubmKlisRMhRkDAVgGbVhZamShsQo
Output for 5.5.3
zyLkWhFbRnmASkVnvVIoWWQwrRQmLfWU
Output for 5.5.2
MaaGIpyYLYSddZUjxphpgQTVjFNoTXuU
Output for 5.5.1
NtDqkzWPYhEwtusAzCwqvJLfHKeWHZNd
Output for 5.5.0
DJITatBgVcJmIwjKaqdhYVzNINqgYZFF
Output for 5.4.45
AOijTBFIXGhkWMorcRRUNcIfRwDjKCJl
Output for 5.4.44
siGLiPDCjYjfLiwjFLXEttzQAShMahES
Output for 5.4.43
TVDuIMXoAaXTeikdJfWCVBVAWloOIlYz
Output for 5.4.42
dVVLshxiOgXcrHMrDuQuLEyQhqjeKXep
Output for 5.4.41
FqjJNdopdkAXWESTuQmTERPbWfRiJDXI
Output for 5.4.40
xSMgyHMDmBFjhOgZmJWHlWSzdYFCDeOs
Output for 5.4.39
ArAkxxDUzVipRKvqtXRNEqBupdwedSIv
Output for 5.4.38
qQUKnELlwFISxXEayqlDTNSVkHrNBmgD
Output for 5.4.37
LutOSYrSTNfmwDSNyyfsFTRKzSNznZFW
Output for 5.4.36
ZSYtJwHoouuYZlKenBHMtMOBbRKmRWLw
Output for 5.4.35
uWrJRASoPNRiUbeZLiZyuBTGbLlgSGGl
Output for 5.4.34
lqzLYUcxHUZkwBuOOACPiFlJCMWrVPgT
Output for 5.4.32
IhTTYtGhgbPIgBCYFLoUfHEOpnrVVsPj
Output for 5.4.31
OaWWZMKfgssxXpXCTpTMwQNhRJVDyRvy
Output for 5.4.30
fnDUGtisjYZbVvLRPSblGbpWoReFnslJ
Output for 5.4.29
gYvXcNkNenvgLbwTHuMVdENcTfzlYPyW
Output for 5.4.28
KhFFTQQQqiBDVmzcbZGWkJyVVMxvZkrO
Output for 5.4.27
AkBiZjkoBTluSPTDhiswAZlFtetSyhZb
Output for 5.4.26
zGiNpWALAICGSZlEREuKqSWKotdOmAFk
Output for 5.4.25
TUQOhzaCSnGnmyjTibnyvTDxlDCWcMBA
Output for 5.4.24
YTSotFQDIxDNeYQOOHdHlAlPXZPKoYju
Output for 5.4.23
IZpXmeRkWHEcKgZZlCblqXogjewSRzCf
Output for 5.4.22
MTnrRxXCpBYGOoVHoKLpldSJZSoOShNp
Output for 5.4.21
LZwcINtWsWmjFgBNSXqBsAvAfvNNMZWv
Output for 5.4.20
KlqqMKYvvTczytvyDsndlEWsnrKQwYsG
Output for 5.4.19
chwsVNxlaIaNeuTmhtwxpJSzYBcNNkHb
Output for 5.4.18
cnywzyoRLMWuAopzlHDfeWAouNhmgHbk
Output for 5.4.17
rgLRExLLlVNARCxIAIWsFfhkLoSvEVRL
Output for 5.4.16
nsbpNDrkmPGSJHHGPYGlfHRqGjzOpnVa
Output for 5.4.15
XuDvxIPRNTOPDyHOHmUlfsAFNkRpnpuQ
Output for 5.4.14
ntDiKoITBiqgOeWDrPIJoZWMfBQTmxAY
Output for 5.4.13
hOIzxvCZmOglTNtuTGrXjSuuYHYkPPMl
Output for 5.4.12
XJBSvcecYVklFUHcfBpHVameeYrHQREF
Output for 5.4.11
ivIxXfYInEenWnmyDzLwjkKENNKnlKjP
Output for 5.4.10
kJiDJBQfhzkgOmkEhGmErvHlSJmseNlu
Output for 5.4.9
ljmzGmhnothttMNJZizVMJaAwOrEmxTa
Output for 5.4.8
TVpNmYoIGjmkFBZonzrkCmeuzcQZRSeg
Output for 5.4.7
BVeZjHQpHWxsiTqfpzOxlaBQmdssXMNt
Output for 5.4.6
axKHdkKqWdBEFNHfDrwHqyjUEqPWtpkc
Output for 5.4.5
WNwNCdMocbuRlbMHSmfQnGDxAzdWrqoO
Output for 5.4.4
qTUzqCIrRdKFdFpmdbGDStKMiWsgYiZW
Output for 5.4.3
BBXSbxjjdIDWBrClZHzDzosFvAySmEpA
Output for 5.4.2
EaBozMZwrcdUFfwwdHBMYZkLUeeyXwIw
Output for 5.4.1
evoMoUZfKSIOgKmeTmgvWhrpgNuHnUMr
Output for 5.4.0
iWHHzbwEpXInvrxPuqklPNuIGqbfglRr
Output for 5.3.29
FAfJdFIKHJCWuETSiTnDzCOYAXGDoKCP
Output for 5.3.28
ZeKxzmjNrKBZkYEvovPANPzPpxZKDbJq
Output for 5.3.27
EsCYvaKYOCgClxQBcpRRWGzBTjrnhhNY
Output for 5.3.26
FBfpwrCeslgOaqvFBknjTFaitkvpqoFd
Output for 5.3.25
YCiWdOkheCHaWeGrTyvtpuBKiuHOIYNj
Output for 5.3.24
sNbHAmybXnJucfxvHOJjIHcLYhawHost
Output for 5.3.23
XcSxDWcjTnoIBpAJQCbfKjUwntKYzgaz
Output for 5.3.22
ivNMTVdJzQuFcDeRQTPYUnCyvRnbXJJe
Output for 5.3.21
cfiyjixIYHJxuGnORFBFQBShIXtlJETx
Output for 5.3.20
BWbDHWnxXYdWWxymdIqyuqkiMVXZyWSs
Output for 5.3.19
KFzJaEeTYUfqmYgBidttJGyGcnlXHbBv
Output for 5.3.18
vznntduycrefUqkELBdEZgSVccfuCeWs
Output for 5.3.17
YaRsSWPHQcYqFOBdHcFjwGgIxsqvDsSh
Output for 5.3.16
fnPcleBURbcFAcBQPfHoOhYdViwKdfsS
Output for 5.3.15
lURztyCcmIQjlUSFsJhFKZqWngcPQtNx
Output for 5.3.14
rMYsdQVLudaqexGEGBwNbACQFnrFSalc
Output for 5.3.13
qexqFsInJshGOaQMxWmkwGVybaDpARwT
Output for 5.3.12
FkUbxxbpRAapAwFDixpLXhgGvUrLGoyE
Output for 5.3.11
amDFtfHdzWDVpgDfEWOZRCWiNrtizjGT
Output for 5.3.10
jneXeXLgBYZixINzrMXRQkOSohTxVQJX
Output for 5.3.9
cQREdyqLfWThImTuJwSGRwuwPvSZPDIo
Output for 5.3.8
nzLJJuYbiRsyTwkbTknclwrBmLttAEUZ
Output for 5.3.7
zaoixIcQMTUXGAQfFjslyHWnmOMIQqSv
Output for 5.3.6
CQWCfKcXVdDQlGbjlNcdfQulLVqjCQuj
Output for 5.3.5
tqrfaXSHFktdLpOZUecNdvAsYKxzWMWM
Output for 5.3.4
NanALYcFypWfjFEmQGAAPCjkfspGTdYd
Output for 5.3.3
tHFcfFSjnfGoQxnttnKwPfBIiKKDrIwT
Output for 5.3.2
pmqYlJcJePQpnDfMdinRYOKfUWhzBUtG
Output for 5.3.1
GiKspLZTbMrQiyzcZZxNVyfogszgQTAM
Output for 5.3.0
lJeKbcFSCPjigirrRtLTopyiKXKTtAFM
Output for 5.2.17
YEBznHUtAjmYnujPTeSQSYvlNgXqnowh
Output for 5.2.16
iTLEIlzVrhavriVXcNGCWQrLpIaadvDs
Output for 5.2.15
YNZdpFRgFRjjumJBlsHJnxekOVEGaFdh
Output for 5.2.14
DQpyaLOeYZTUxstAYlEcMjusklskcECd
Output for 5.2.13
IsLEKIgXPNwdXzqxEywqwbmOekveLRLa
Output for 5.2.12
pCdotXULoJHhdNxCMeHmwmHJrEYhCahS
Output for 5.2.11
kxWtcVoAsRgqtzPTLhTmiFRsiKkxgxQr
Output for 5.2.10
gDOgWaKdAAfspiBgUoZuEhesKzZLfLNT
Output for 5.2.9
IcxgzSfJRfjxGUcRdERUnMYHenbxdXwz
Output for 5.2.8
IjQxUZQKJQjhcAPyxflbsuckmEKwoEOq
Output for 5.2.7
vfspEsCyXxceBBCFGOlYBIpehttCDMmh
Output for 5.2.6
eWQuBncgJsrdZAGUyUHpHAypyOMkaGkT
Output for 5.2.5
LvzKpvFsjrrWfEkGyghVFaEQtVScaoaT
Output for 5.2.4
vHuqDnWFNKEcaRVLQwSbnWBTuISmNhee
Output for 5.2.3
ZnISHOJDdgtrvrkOwJDeidiGIHqWgzhT
Output for 5.2.2
LpkcKAUnrLYIdrPHOsbsxHCKhBibCXQd
Output for 5.2.1
VoSnsHxmLxjGhhJCwkNpWnHlvnqgfcFZ
Output for 5.2.0
NFYdnkdKPlGsjrQPeEiXkvlgKYLBpTuE
Output for 5.1.6
GRRSGbCVYfHntMiFQOKIfEPrkfeNcNIa
Output for 5.1.5
vyhgPVOciUBSaWcrqDciRIlEfLENBeiC
Output for 5.1.4
WqXyToCcMKrqtrRByERyFzDwPNkraCwg
Output for 5.1.3
xvMyPgkIsuBNoGphdWtblWpMoyweXOMx
Output for 5.1.2
TuxDyoztbdKEmpSebqyiAxecNoIOebrF
Output for 5.1.1
YudsSRFYEebymHwiQQwoEIGkGYGCpzvk
Output for 5.1.0
raKasjUBxOvtZlLRbwSuOcFXnjThvZru
Output for 5.0.5
bOBuorNrWaPxvaCLWrjLnhoJZVczNzbE
Output for 5.0.4
kuHzpjkyjOhLygwjmUqFZlerURaCYtmX
Output for 5.0.3
sFBJjHrXWzhipyPRoxEEtjwpcrjEmFlq
Output for 5.0.2
uNUsCKmCHMtdawYAuxojzFCvunREVNTe
Output for 5.0.1
ByulkTIXlTwmPlGVnsZUQtpQTyVFWLRM
Output for 5.0.0
QqJYGjxoCGIPWHVUSxbMiImOtHEVoapx
Output for 4.4.9
hnRikTJErthdygvJPyEyQkTcrCqYELUt
Output for 4.4.8
vNyiwPSoAXhTROTprljQbZjIXwStjZkt
Output for 4.4.7
pdFVrthjlpalIsDmBojZKZQJzECplYcg
Output for 4.4.6
BknxGSOnoPaRJxztoYqciaryqwTqgysJ
Output for 4.4.5
ekgAIoKFMmSUkThcxQKcKYGCEvJSPmkw
Output for 4.4.4
eBNrnBxzxzqLXXurXOAiSqkIfrrHSvzf
Output for 4.4.3
yPpIJSzRqBtygBqPtqnMOLiLdgJDqFfh
Output for 4.4.2
JhxBshHGUFXcqzQsmfmjQTfNuhdpCLZy
Output for 4.4.1
LSLKlZXhpbputcgVMFLfctdGoPHRgfQS
Output for 4.4.0
SJrinCSPlDFcPWpQADovpxkLUxVepRjR
Output for 4.3.11
HsdyLXWVxUHHIdMutLYgmOnswOkrppwl
Output for 4.3.10
UqxLAgrtpRVANDGSPsWkXbWPgkhpMwap
Output for 4.3.9
IRcpPTXORvkcAkvfGgKCCpZpXOEfUvuJ
Output for 4.3.8
ylYQLMaLLyrblheoqAdbyiRwrSrNEObW
Output for 4.3.7
wgTgYjOWvFJSaSCChWuuLwsMAgTqnXyH
Output for 4.3.6
aMpKZdaThZkbTdqAzOoScxKyrlfMctxU
Output for 4.3.5
lyXgLpdnwKGSLslFAmmtlIKbZOGypjav
Output for 4.3.4
jzMsinwJFprjBZyHnOEFvojVMyHliqDO
Output for 4.3.3
QCMyVpzInJmdxsqWzCYaObfnUPeHhQSd
Output for 4.3.2
zYHztrtfAjIImmJFHCokjyzfTHKypVWs
Output for 4.3.1
lzzJNGQPsAjOBrkoGKysgqtkCJgDGDfx
Output for 4.3.0
TpHdtpGZoYQDBRQIFVoTUsnDRZdsLyPY