3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function multiID($n=32) { for ($x=$s=$r=0; $x<$n; $x++) { $c = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01234567890'; if (($x<$n) && ($x > 0) && ($s < 2)) { $c .= '-_'; } $g = substr($c, mt_rand(0, strlen($c) - 1), 1); $r .= $g; if (($g == '_') || ($g == '-')) { $s++; } } return $r; } echo multiID(4);
Output for 7.1.0
0zbqF
Output for 7.0.14
00cgc
Output for 7.0.6
0Qt00
Output for 7.0.5
0MVee
Output for 7.0.4
0hns8
Output for 7.0.3
0gGrO
Output for 7.0.2
0y4Dh
Output for 7.0.1
0wSO-
Output for 7.0.0
00vmg
Output for hhvm-3.12.0
00L2m
Output for hhvm-3.10.0
0ENXA
Output for 5.6.28
0HbQf
Output for 5.6.21
0yDr6
Output for 5.6.20
00pdQ
Output for 5.6.19
0A1J-
Output for 5.6.18
0lZlQ
Output for 5.6.17
0GH07
Output for 5.6.16
01KN3
Output for 5.6.15
0aJDV
Output for 5.6.14
0DxKN
Output for 5.6.13
0WqGU
Output for 5.6.12
0mlNP
Output for 5.6.11
04Umd
Output for 5.6.10
00yyo
Output for 5.6.9
0Vu3s
Output for 5.6.8
0XeNa
Output for 5.6.7
0v268
Output for 5.5.35
0zPIZ
Output for 5.5.34
0ny3Y
Output for 5.5.33
02B6U
Output for 5.5.32
0S07L
Output for 5.5.31
07XN2
Output for 5.5.30
0Lkke
Output for 5.5.29
0S_WS
Output for 5.5.28
0GNyj
Output for 5.5.27
0U0lT
Output for 5.5.26
0UFrL
Output for 5.5.25
0xNLX
Output for 5.5.24
0HyYQ
Output for 5.4.45
019d_
Output for 5.4.44
02LVS
Output for 5.4.43
00Kz4
Output for 5.4.42
0FaSj
Output for 5.4.41
0DbCh
Output for 5.4.40
0CdJA
Output for 5.4.39
0U3v0
Output for 5.4.38
0G7wH
Output for 5.4.37
03Z0R
Output for 5.4.36
0cOiQ
Output for 5.4.35
0pUtW
Output for 5.4.34
0kMGK
Output for 5.4.32
0Z-UT
Output for 5.4.31
095Wo
Output for 5.4.30
0vZgL
Output for 5.4.29
09D_N
Output for 5.4.28
0U_oc
Output for 5.4.27
0pgwE
Output for 5.4.26
0ipey
Output for 5.4.25
0n88c
Output for 5.4.24
02EtL
Output for 5.4.23
0bGkC
Output for 5.4.22
0kbLH
Output for 5.4.21
0SAAT
Output for 5.4.20
0mOp5
Output for 5.4.19
0adf5
Output for 5.4.18
0t7Rg
Output for 5.4.17
01502
Output for 5.4.16
0HM-F
Output for 5.4.15
0nEcg
Output for 5.4.14
05k5m
Output for 5.4.13
0bTsX
Output for 5.4.12
0AAON
Output for 5.4.11
0zSSW
Output for 5.4.10
0wEdH
Output for 5.4.9
0NTE_
Output for 5.4.8
0yWhg
Output for 5.4.7
0p4NE
Output for 5.4.6
0mRvm
Output for 5.4.5
01ed9
Output for 5.4.4
0VNmi
Output for 5.4.3
0XnPO
Output for 5.4.2
024oP
Output for 5.4.1
0j2_i
Output for 5.4.0
0HHQA
Output for 5.3.29
0E_Ja
Output for 5.3.28
0sfqP
Output for 5.3.27
067Jy
Output for 5.3.26
0lQFF
Output for 5.3.25
0Luai
Output for 5.3.24
0Eq96
Output for 5.3.23
0a1Rx
Output for 5.3.22
0sJLb
Output for 5.3.21
0QNd0
Output for 5.3.20
07CLQ
Output for 5.3.19
0hQwT
Output for 5.3.18
0H9Ie
Output for 5.3.17
0otVo
Output for 5.3.16
0TBZ8
Output for 5.3.15
069Af
Output for 5.3.14
0ct57
Output for 5.3.13
0wlv7
Output for 5.3.12
0E_5t
Output for 5.3.11
0GSLA
Output for 5.3.10
0HhZc
Output for 5.3.9
0jkyZ
Output for 5.3.8
060Eu
Output for 5.3.7
0e47g
Output for 5.3.6
05SNr
Output for 5.3.5
0I22E
Output for 5.3.4
0eLn4
Output for 5.3.3
0XK3j
Output for 5.3.2
0OWVR
Output for 5.3.1
0b7rW
Output for 5.3.0
00R9B
Output for 5.2.17
0Iipl
Output for 5.2.16
0NT01
Output for 5.2.15
0kNKD
Output for 5.2.14
0qid5
Output for 5.2.13
0MZhc
Output for 5.2.12
0c0NW
Output for 5.2.11
0ItFh
Output for 5.2.10
09j_j
Output for 5.2.9
0A_YH
Output for 5.2.8
0y9Kj
Output for 5.2.7
0Ot93
Output for 5.2.6
0UNd1
Output for 5.2.5
0pBpm
Output for 5.2.4
0AAfJ
Output for 5.2.3
05BK2
Output for 5.2.2
0hRWe
Output for 5.2.1
0G9rb
Output for 5.2.0
0ZwLI
Output for 5.1.6
0EDxw
Output for 5.1.5
010YS
Output for 5.1.4
0KozG
Output for 5.1.3
0M6_e
Output for 5.1.2
0HhWb
Output for 5.1.1
0U8Gy
Output for 5.1.0
0jq33
Output for 5.0.5
0Ojs-
Output for 5.0.4
0Rtal
Output for 5.0.3
0z2UL
Output for 5.0.2
0JdS1
Output for 5.0.1
0dSJf
Output for 5.0.0
0Hp2f
Output for 4.4.9
0gTHO
Output for 4.4.8
0T5hk
Output for 4.4.7
0zGSn
Output for 4.4.6
0HbTg
Output for 4.4.5
0ny0w
Output for 4.4.4
0HuF6
Output for 4.4.3
0p5la
Output for 4.4.2
0jNov
Output for 4.4.1
047Xa
Output for 4.4.0
0YwJr
Output for 4.3.11
0qQ3r
Output for 4.3.10
0qXwa
Output for 4.3.9
0eLWF
Output for 4.3.8
0ggc6
Output for 4.3.7
0ouaQ
Output for 4.3.6
03N3r
Output for 4.3.5
02iVP
Output for 4.3.4
0DagK
Output for 4.3.3
0M9A1
Output for 4.3.2
0sS0o
Output for 4.3.1
0yUwQ
Output for 4.3.0
0VyIP