3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function GeneratePassword($i,$s){ $r='';$s=str_split($s); for($i; $i>0; $i--)$r.=array_rand($s); return $r; } echo GeneratePassword(5,'wffweg');
Output for 7.1.0
14200
Output for 7.0.14
45253
Output for 7.0.6
24244
Output for 7.0.5
33043
Output for 7.0.4
10025
Output for 7.0.3
30041
Output for 7.0.2
22551
Output for 7.0.1
34355
Output for 7.0.0
23521
Output for 5.6.28
42032
Output for 5.6.21
00422
Output for 5.6.20
05504
Output for 5.6.19
23522
Output for 5.6.18
22300
Output for 5.6.17
42135
Output for 5.6.16
42353
Output for 5.6.15
30022
Output for 5.6.14
34353
Output for 5.6.13
41030
Output for 5.6.12
31403
Output for 5.6.11
20533
Output for 5.6.10
34002
Output for 5.6.9
24222
Output for 5.6.8
55403
Output for 5.5.35
02020
Output for 5.5.34
32234
Output for 5.5.33
31054
Output for 5.5.32
10031
Output for 5.5.31
53414
Output for 5.5.30
20221
Output for 5.5.29
44231
Output for 5.5.28
03331
Output for 5.5.27
43002
Output for 5.5.26
10242
Output for 5.5.25
05555
Output for 5.5.24
40033
Output for 5.4.45
25501
Output for 5.4.44
11144
Output for 5.4.43
40113
Output for 5.4.42
03205
Output for 5.4.41
42421
Output for 5.4.40
30550
Output for 5.4.39
20233
Output for 5.4.38
32431
Output for 5.4.37
51113
Output for 5.4.36
54335
Output for 5.4.35
31020
Output for 5.4.34
25511
Output for 5.4.32
35120
Output for 5.4.31
00352
Output for 5.4.30
53152
Output for 5.4.29
20423
Output for 5.4.28
20243
Output for 5.4.27
24241
Output for 5.4.26
43200
Output for 5.4.25
23003
Output for 5.4.24
23552
Output for 5.4.23
14131
Output for 5.4.22
01205
Output for 5.4.21
21202
Output for 5.4.20
02304
Output for 5.4.19
53101
Output for 5.4.18
53043
Output for 5.4.17
51453
Output for 5.4.16
34334
Output for 5.4.15
11233
Output for 5.4.14
10352
Output for 5.4.13
43034
Output for 5.4.12
41515
Output for 5.4.11
23200
Output for 5.4.10
33220
Output for 5.4.9
22240
Output for 5.4.8
55521
Output for 5.4.7
55010
Output for 5.4.6
22011
Output for 5.4.5
52241
Output for 5.4.4
35311
Output for 5.4.3
43555
Output for 5.4.2
14103
Output for 5.4.1
53405
Output for 5.4.0
31410
Output for 5.3.29
44045
Output for 5.3.28
11354
Output for 5.3.27
10334
Output for 5.3.26
50555
Output for 5.3.22, 5.3.25
45032
Output for 5.3.24
00553
Output for 5.3.23
54050
Output for 5.3.21
15441
Output for 5.3.20
12305
Output for 5.3.19
00505
Output for 5.3.18
05324
Output for 5.3.17
41251
Output for 5.3.16
34132
Output for 5.3.15
53140
Output for 5.3.14
22425
Output for 5.3.13
20550
Output for 5.3.12
05501
Output for 5.3.11
33422
Output for 5.3.10
24103
Output for 5.3.9
42120
Output for 5.3.8
33113
Output for 5.3.7
33452
Output for 5.3.6
44552
Output for 5.3.5
03530
Output for 5.3.4
03435
Output for 5.3.3
51231
Output for 5.3.2
43005
Output for 5.3.1
23144
Output for 5.2.11, 5.3.0
32540
Output for 5.2.17
45303
Output for 5.2.16
23312
Output for 5.2.15
42053
Output for 5.2.14
21432
Output for 5.2.13
10233
Output for 5.2.12
20001
Output for 5.2.10
44521
Output for 5.2.9
11100
Output for 5.2.8
52542
Output for 5.2.7
00042
Output for 5.2.6
34035
Output for 5.2.5
15300
Output for 5.2.4
21024
Output for 5.2.3
41405
Output for 5.2.2
55332
Output for 5.2.1
03413
Output for 5.2.0
40224
Output for 5.1.6
10121
Output for 5.1.5
05233
Output for 5.1.4
20520
Output for 5.1.3
24320
Output for 5.1.2
13233
Output for 5.1.1
30221
Output for 5.1.0
23203
Output for 5.0.5
53442
Output for 5.0.4
54522
Output for 5.0.3
24504
Output for 5.0.2
42052
Output for 5.0.1
55313
Output for 5.0.0
43515
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: str_split() in /in/k5A4P on line 3
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: str_split() in /in/k5A4P on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: str_split() in /in/k5A4P on line 3