3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function genKey($length) { if($length > 0) { $rand_id=""; for($i=1; $i <= $length; $i++) { mt_srand((double)microtime() * 1000000); $num = mt_rand(1,72); $rand_id .= assign_rand_value($num); } } return $rand_id; } function assign_rand_value($num) { switch($num) { case "1": $rand_value = "a"; break; case "2": $rand_value = "b"; break; case "3": $rand_value = "c"; break; case "4": $rand_value = "d"; break; case "5": $rand_value = "e"; break; case "6": $rand_value = "f"; break; case "7": $rand_value = "g"; break; case "8": $rand_value = "h"; break; case "9": $rand_value = "i"; break; case "10": $rand_value = "j"; break; case "11": $rand_value = "k"; break; case "12": $rand_value = "l"; break; case "13": $rand_value = "m"; break; case "14": $rand_value = "n"; break; case "15": $rand_value = "o"; break; case "16": $rand_value = "p"; break; case "17": $rand_value = "q"; break; case "18": $rand_value = "r"; break; case "19": $rand_value = "s"; break; case "20": $rand_value = "t"; break; case "21": $rand_value = "u"; break; case "22": $rand_value = "v"; break; case "23": $rand_value = "w"; break; case "24": $rand_value = "x"; break; case "25": $rand_value = "y"; break; case "26": $rand_value = "z"; break; case "27": $rand_value = "0"; break; case "28": $rand_value = "1"; break; case "29": $rand_value = "2"; break; case "30": $rand_value = "3"; break; case "31": $rand_value = "4"; break; case "32": $rand_value = "5"; break; case "33": $rand_value = "6"; break; case "34": $rand_value = "7"; break; case "35": $rand_value = "8"; break; case "36": $rand_value = "9"; break; case "37": $rand_value = "*"; break; case "38": $rand_value = "~"; break; case "39": $rand_value = "-"; break; case "40": $rand_value = "|"; break; case "41": $rand_value = "^"; break; case "42": $rand_value = "%"; break; case "43": $rand_value = " "; break; case "44": $rand_value = "_"; break; case "45": $rand_value = "+"; break; case "46": $rand_value = "="; break; case "47": $rand_value = "A"; break; case "48": $rand_value = "B"; break; case "49": $rand_value = "C"; break; case "50": $rand_value = "D"; break; case "51": $rand_value = "E"; break; case "52": $rand_value = "F"; break; case "53": $rand_value = "G"; break; case "54": $rand_value = "H"; break; case "55": $rand_value = "I"; break; case "56": $rand_value = "J"; break; case "57": $rand_value = "K"; break; case "58": $rand_value = "L"; break; case "59": $rand_value = "M"; break; case "60": $rand_value = "N"; break; case "61": $rand_value = "O"; break; case "62": $rand_value = "P"; break; case "63": $rand_value = "Q"; break; case "64": $rand_value = "R"; break; case "65": $rand_value = "S"; break; case "66": $rand_value = "T"; break; case "67": $rand_value = "U"; break; case "68": $rand_value = "V"; break; case "69": $rand_value = "W"; break; case "70": $rand_value = "X"; break; case "71": $rand_value = "Y"; break; case "72": $rand_value = "Z"; break; } return $rand_value; } echo genKey(10);
Output for 7.1.0
D_JwPK6^YH
Output for 7.0.14
IpKM~bm5P7
Output for 7.0.10
XoO^o7okvG
Output for 7.0.9
|H3gftYW D
Output for 7.0.8
nOI aYtQKO
Output for 7.0.7
LESO2U0b2w
Output for 7.0.6
TeAe18a8M5
Output for 7.0.5
A4A5OY9*zF
Output for 7.0.4
iI+J%SQmEg
Output for 7.0.3
_JwPeI-=62
Output for 7.0.2
e%-_U3jkpV
Output for 7.0.1
6lcunDxt~Y
Output for 7.0.0
*Ep1W1k3R=
Output for 5.6.28
uDo* x_mc~
Output for 5.6.25
w=v~6bbtQE
Output for 5.6.24
-y-zrYy2rR
Output for 5.6.23
-ULnWyPY-j
Output for 5.6.22
MDPPAWm 4a
Output for 5.6.21
nDJRtC++Y
Output for 5.6.20
8FAsEq|L8B
Output for 5.6.19
AoJHXCfLMm
Output for 5.6.18
raujR33dpW
Output for 5.6.17
b~rEP5ExaX
Output for 5.6.16
U=lth_dsV%
Output for 5.6.15
**nAWSUu_j
Output for 5.6.14
3osyDi+Kxb
Output for 5.6.13
bGlpe8uzo
Output for 5.6.12
2t-r L0MKw
Output for 5.6.11
*6bt^*QlnJ
Output for 5.6.10
Agw_za6W+D
Output for 5.6.9
r8H8+G8-wV
Output for 5.6.8
lHEZ^25bwS
Output for 5.6.7
bX+WQKo2tC
Output for 5.6.6
8Y^-o1HewA
Output for 5.6.5
fhD9XU5t|r
Output for 5.6.4
CLaQEWF2sQ
Output for 5.6.3
cAB0G|CCib
Output for 5.6.2
yiCbGlwOui
Output for 5.6.1
RWDsKdVxCq
Output for 5.6.0
khvF-_Vpnb
Output for 5.5.38
QfdDqNrrvZ
Output for 5.5.37
f*4coai5hw
Output for 5.5.36
PLfDi+K b|
Output for 5.5.35
G6%rXp%Ioa
Output for 5.5.34
UcZi5dwLOQ
Output for 5.5.33
yOi2zBPBxm
Output for 5.5.32
pibg%V*O|D
Output for 5.5.31
1ZGSGFz84W
Output for 5.5.30
ecZvJ^0-2S
Output for 5.5.29
GLdU5A8YB=
Output for 5.5.28
Pk68E_IoJH
Output for 5.5.27
AoJHXCqLd3
Output for 5.5.26
ISDwKKspXz
Output for 5.5.25
r4Rl7o=nAW
Output for 5.5.24
zy6 f3bGEe
Output for 5.5.23
d|Y81Fxt6W
Output for 5.5.22
| KY%T_S I
Output for 5.5.21
GCQoZrM=5-
Output for 5.5.20
JRTw=RXDsK
Output for 5.5.19
y-ogYy2rRl
Output for 5.5.18
Br*ph4Iafw
Output for 5.5.16
OFP2Cy1b6P
Output for 5.5.15
YCt5wf8H*R
Output for 5.5.14
WYM5mN*Gm9
Output for 5.5.13
5L=Rw3Ru~^
Output for 5.5.12
Gct~vAa0oO
Output for 5.5.11
NeW4Sxrb0Y
Output for 5.5.10
nhrRRmfHfI
Output for 5.5.9
Ih0ySW3g6q
Output for 5.5.8
y%R Mk2xmk
Output for 5.5.7
GAx803tg^
Output for 5.5.6
TaJRysr^zU
Output for 5.5.5
HWNzE%8O5E
Output for 5.5.4
uK_0y4*kqr
Output for 5.5.3
D5fuwWJgcr
Output for 5.5.2
UHgCuJuGf
Output for 5.5.1
LG*w=nIWSk
Output for 5.5.0
Kx68iQiZj_
Output for 5.4.45
M8a_SfcDD8
Output for 5.4.44
14BnmOVNcl
Output for 5.4.43
LY4QJH+z5%
Output for 5.4.42
frkfHH-pWH
Output for 5.4.41
%~8NuDT8KT
Output for 5.4.40
m4n9aY1||2
Output for 5.4.39
AEDW51-uvM
Output for 5.4.38
ptSHyosmlR
Output for 5.4.37
bXpKbFKc8B
Output for 5.4.36
BS|f8TNMz-
Output for 5.4.35
z1VfDt-Uo|
Output for 5.4.34
_4GWNuJuam
Output for 5.4.32
6=tXhX6 KR
Output for 5.4.31
TPD7Rkj-uv
Output for 5.4.30
q3kJjX0ybd
Output for 5.4.29
vUhQ=rM2X6
Output for 5.4.28
k1Jf%C6YxJ
Output for 5.4.27
c0QARqHICf
Output for 5.4.26
xt*ZUqQP*C
Output for 5.4.25
_|--SH5d%V
Output for 5.4.24
C%lCDDFn1w
Output for 5.4.23
5XNyMvnBHp
Output for 5.4.22
jmdAxWM1-u
Output for 5.4.21
DHgx_t%Xyw
Output for 5.4.20
IS VM3T%0Q
Output for 5.4.19
g _pKI~bP
Output for 5.4.18
Ljf2Zdc%tY
Output for 5.4.17
D8KbOKx8Bc
Output for 5.4.16
VZulfJfgO6
Output for 5.4.15
iZs*ZIoWa^
Output for 5.4.14
t_hZNanhzV
Output for 5.4.13
n1NWha3Qka
Output for 5.4.12
^EC8lyD-N7
Output for 5.4.11
iWZWYNN60w
Output for 5.4.10
gYl+5g |e=
Output for 5.4.9
A4nMyN%IZH
Output for 5.4.8
X_SZMaHBPJ
Output for 5.4.7
KDO0xz9lpp
Output for 5.4.6
91R3|WmTB_
Output for 5.4.5
gUxGC+L7UB
Output for 5.4.4
|oAaS1uOHB
Output for 5.4.3
I9XSprXZ6Q
Output for 5.4.2
_JVTrQ6a0z
Output for 5.4.1
YUShE3=Nki
Output for 5.4.0
-1OvZms||3
Output for 5.3.29
jTwZ22bc~
Output for 5.3.28
n-qNanh^_F
Output for 5.3.27
MHiUziS6vj
Output for 5.3.26
a^3hppJCwU
Output for 5.3.25
raoUGj*PBZ
Output for 5.3.24
a_lCQdlmAd
Output for 5.3.23
t5H^^OHBPJ
Output for 5.3.22
Iz=19iNQ|L
Output for 5.3.21
8qz3h9HQWT
Output for 5.3.20
KS++NzxYPc
Output for 5.3.19
qDd1RQUm+^
Output for 5.3.18
jH_dNNUYLY
Output for 5.3.17
mY|kUYbN4f
Output for 5.3.16
b2cKS++*WY
Output for 5.3.15
WS%=3PliWM
Output for 5.3.14
7ndz% xLDy
Output for 5.3.13
9T4O+ONxLD
Output for 5.3.12
M73S6g+bNz
Output for 5.3.11
7kL+LYcy|W
Output for 5.3.10
S1%aDGKA~H
Output for 5.3.9
BZTi%LILLb
Output for 5.3.8
+34RF|WMnZ
Output for 5.3.7
D=IL+LYcyl
Output for 5.3.6
Ch=rpoFu6B
Output for 5.3.5
A|5qF9Yhs
Output for 5.3.4
73QLwpETd*
Output for 5.3.3
r+Fq1w|E C
Output for 5.3.2
ynppWNUQ%O
Output for 5.3.1
Q96KqpZ4YI
Output for 5.3.0
=Pa=J2KPsh