3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function crypto_rand_secure($min, $max) { $range = $max - $min; if ($range < 0) return $min; // not so random... $log = log($range, 2); $bytes = (int) ($log / 8) + 1; // length in bytes $bits = (int) $log + 1; // length in bits $filter = (int) (1 << $bits) - 1; // set all lower bits to 1 do { $rnd = hexdec(bin2hex(openssl_random_pseudo_bytes($bytes))); $rnd = $rnd & $filter; // discard irrelevant bits } while ($rnd >= $range); return $min + $rnd; } function getToken($length){ $token = ""; $codeAlphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; $codeAlphabet.= "0123456789"; for($i=0;$i<$length;$i++){ $token .= $codeAlphabet[crypto_rand_secure(0,strlen($codeAlphabet))]; } return $token; } echo getToken(60);
Output for 7.1.0
2IBA6WL9831VSMRAF1DJ3XAP37INJIFBS810V1ZF05V1L3TNWBC3MS0XPOIW
Output for 7.0.14
222761DJ0JXGKH3W514VTRJHQ2TC3TV0JO3T8XUBPQ2T7R9A56HSTO15CAWM
Output for 7.0.7
50T45QU5YY8BPYS2W0FV4L8J2CDFJMCDXR4Z73PSG06LUIFXXXCY0ZWE6WW6
Output for 7.0.6
1QXSEVPKDWTMF1IH1WNZWCYCWTR8F8KA5P8FL8KZ21O3NI1XK6DKD4DYFPRZ
Output for 7.0.5
FNOGKC5UB7FO7YGMYE68BHRGCBEE8AWX46DT51G0PEUG87K7QU0ELFZH16MS
Output for 7.0.4
OEJC636UBKNDIVVCZ1MXXV6CGIU6L6FSV4L3XVHF3T38FIQFM962Q4QINLHX
Output for 7.0.3
7BUPHDXREBISE00HFURH4LCXZDMJTDMXGPTPTQUDU7MNJCBWBO43HOAIOIXD
Output for 7.0.2
XU9EA4TN7UHNJWXC4J8NN4R0140AZ8UI0R9BBL49SUYE06LQW9BFEOGKWE6M
Output for 7.0.1
KWGK4F5E0JLCP3YHZD68R8BF50TA4VAVLKKII5FUF7VON2L3EZ7TB1KX5W4R
Output for 7.0.0
C7ZBU94OMEWKWQARU5LDQQSM79B97LWGH48B6GMUU16YL95JPWFOZCQRGI3Q
Output for 5.6.28
07YCOVIT8XB10846OK3PN8AZFSBAFR4KAV8444M0EBR17O8QC97F9STZARQ2
Output for 5.6.22
5MY0QQ2JHH2J941FZGSBS05MBVW9YV3U0528ETN4SF96ULE4B4UBU93XZ2Q1
Output for 5.6.21
2FFW46Q13KLXN2U3394VCFGBCZ4X0A9BI2UTHXYRM3UBZTBAB5W6M6TNONQI
Output for 5.6.20
KDH7DRDWV72EYD7AL53GY82AZ0IC2HEZ3K14721DIRWF8MGYO9AHLR0K7SJK
Output for 5.6.19
95FKFBI9LX6WA9GYWYMC2EYLHRNIYPTI3VT7EJ0YL6XBSJWAK7MCG83LLZJG
Output for 5.6.18
CE7APL6I5SJMS0OHFT1V7FPYQSX5XPND594Q2S0T3ED41CZ071HJ6TNFE7FT
Output for 5.6.17
46Q9W23F09IHP4549SQ1I8BCFJPNCVT1TSZIGQASBXPMWV2SN23IE92FLW9D
Output for 5.6.16
DRAEE44KZFVASW1EKE2W53D7RULMITAXD995DZ91TT81S3A1C43C2TLL75XP
Output for 5.6.15
0NURX93PN8SJPFCUCGR52V546W6Y236H76XC7B9R5ONZNZ9DWYWM53182DJH
Output for 5.6.14
ICTUQJ2NUMZ3TNW2W2UWX6EDSYE392UHBLXAUKK0JIABU7ZY6BHW8URPG9VX
Output for 5.6.13
3JIWQZNWR1B4YL6QZNSGPS4U3UX5KCNRZHFE73HPSFO0UAH1392NYFDLA4GW
Output for 5.6.12
PGKNK3Y6AZFRNS659JW8DV9711MYDUWOM949D9XU5JUT7GE0TU4HILJJ91XV
Output for 5.6.11
QFEIEFCI82A069LXE16ZMS2LUIIOAHIJYL6RZIPA7JZZ3X6KHH7PLEPCTWQ3
Output for 5.6.10
WH3PVVDWQ3QZEN8HT4F911BNBN1VKHXNENJUNPT1Q7SC3P2P99CG5KOJDJY3
Output for 5.6.9
SMXJLCCX964G3EBQYKC9TWCO4FKFX6WWMQIE527XS5VLLZZT95QIOG00PC37
Output for 5.6.8
ASEDV09AJS3PMVGJAOZ9H5H841XTNX0MQ5C5CMDQS6YWF9IA2DSIZK5KIA7C
Output for 5.6.7
JIKYDXCW0GDZAHKOEASOU3O2BM3POR5E3C6K2CLOJVYU0GPM6A6GSGKU8EAS
Output for 5.6.6
HUF168S2EQ4W18NMB789LWFG6K582UP3GZZ2XEWSG8D67ZIW65KHJM3LGXNX
Output for 5.6.5
JMH89UEFZ6IL2UF64DCP9HTLQDWVGTYJAH2MI9CDGJYV4JMFK2IWDIITIZ7U
Output for 5.6.4
F11R0WNHKJAR6BB15ZVHIGIHCHUXDQLFERC1D5FM6D8Q55G67EGAGL7JWPLT
Output for 5.6.3
HY4WGJ05KS32IVU7CVT5THW6DZQXMV0I3XPXGPNXHZBSBCMH2UVH0Y4MO9UU
Output for 5.6.2
VPK7D7Y36IWZH2LNZGCJGDIBRK4Q5BG23Q0UVZPQ1A1M7LS3U6DF3B5ITO8X
Output for 5.6.1
BOVO7Q8EHS9IVON3CL30NR38UYQ1HPMBZ8EJ5OD4RDCJLOR9RGL19ZUEVTD6
Output for 5.6.0
EYFXKFWP196ZHHNYDASHCT9TH2TC2HR3JUZ7JI8IN02QEG9B917OHT3G67SC
Output for 5.5.36
S2VJ9WTOCS1V4D5CQIVN80FJOA69H07FAEXTN9Z99FE8WYIF8UISQ2K06GDF
Output for 5.5.35
L9F1QXYMRPTW5BG6WBT7PNA1G4GDLN7PB2EO7MBIN3HE0EKOTGU34DXK25AD
Output for 5.5.34
IEQVQTT6CDO5C2FY4GQT1XNKAG82ZEL3GGSSF3XM8JZYGXXWUSMHII4H94KK
Output for 5.5.33
1HWRLF1XR9NVR9FCCGA95NB4OGAOU4IO1H7W84FILRKVZ99V7QPENRCLW39I
Output for 5.5.32
UK0383GMYD6X1FE2NDN5PY2S9Z7EYBIVX7YT7VWP64ITKR3IGRX1J5ZY8UN8
Output for 5.5.31
6DF7CB52VFP7TM6IGKL9RIPP6QWA1H51DXCWUB0FB0ECLANHUNU7SLOH47VE
Output for 5.5.30
18DCWKRQWJX9BZK5Y49DN2YX70D6AQDSLXN5JUPEGAKZA0FRWE1MVMDARZY4
Output for 5.5.29
CFIIR0THKER771R8M93UUFWMHAP0Z5XHETYUAWK2DST04AZUQNDP09MST284
Output for 5.5.28
Y3BE2JM7Q1GWDYLU7XWJ87RU5NWHQH6VSO2YX9O1UIRFH8HIT45BGK70Q2Q9
Output for 5.5.27
LBAZ9RCGCDI1Y9FO4PBHSOO8HP6I22OUKT5QX80Q4VXL3WH5RP9BJIW2B8O9
Output for 5.5.26
LO04BVZLD9U0G4N0AUJ3U44VRU1LTJNWFAWOXNL5ECSR5G0D6IO7PSJFA61M
Output for 5.5.25
NDE7R2XFQSGI76IQH0D0BCJOUH25TBCB4ZQ6XBS9KVQ6ON80IF4TSH6T0298
Output for 5.5.24
L5NK60EBJ95RRF0M2O4E835NO04Y60OXAOL2O1OPANG7Q8N9OYNMRLFJR1HP
Output for 5.5.23
X05TF0SG7EZEP7VIX566AL2EFUHBLV4SYAY5M0R1BWYJUISIAJU327LX4RPN
Output for 5.5.22
MD2HAHMS2AJ10SOR80QACGZ795UF77DQCEVYQMRXOEHYH49QP8EP3G8D8ZHP
Output for 5.5.21
WBY5HOJ3JOMYDMPZ11JVUHAHG5W3WXTX2MK3MNB4MCQ3PL9XFNG2O7HR1Y6D
Output for 5.5.20
IBU6D2MGUA52ZVN1ZP8NE51HP7XTE3UB09YXVIC0MJFM112S0VEZTF79PRQW
Output for 5.5.19
FLECCD7ZNER0Z49QVVKWSNSNEQ664L1FLFOZPB0N7YAVO05BPU0853M8Q07B
Output for 5.5.18
9Z3A459ZG80KV3BVLHYWEAG51D7N5CNQ08X6LC3BY9E9FEX0O5OST2HD6SU8
Output for 5.5.16
F1BSDSWNR0WK4KKR1MYIBP59TQDAL3246JC11HDTKMG8NQF1V9BPK099KUVG
Output for 5.5.15
EQPDLGHCS67WUPGSR4ZDBMD9P3M2RVZ46HYAF0GRFEK1AJJYWWJ211GQGAR8
Output for 5.5.14
XC8FSHW33GRK8AWHM9UJ4XWR5X1JBK3IG3WQR76HHZMOPM3DYBTSDT3F989B
Output for 5.5.13
5VR11KAD1BS9O0NUK6GBW3YZZ9EAWDCNBS6WMX0CNJFC1KER9G1S5B1JZH20
Output for 5.5.12
9NNC2GQCP1DR2SI9UCH80SQKAY7GTZELQ0GUCUY3KIFSI17EKK0YT9OLS1CB
Output for 5.5.11
HPYRONIWDI3X30AA5K3CWQGCIO0WGTO31O41YAVQ3XXJA9IT6Z4IW12DP72F
Output for 5.5.10
J9K4EBLJB3IEXZ55ME5MS97UF6YHADPSF75N1FQPDKONUH8R0Z1C4Y2A4YI8
Output for 5.5.9
AHKJ6AU4YT0GYZAI031J7KO1K9SK85WCFXD7O1S6BS9U5NUVDE7MYCGK1UIF
Output for 5.5.8
KR4708VDXPVV7ELS4FP5LZI1ZFO9P2DI24W3HA0XZUBPEIKA8AZX3S2CY2CU
Output for 5.5.7
CVUOWSMHEAIL1J8JA1RA1Q195DEVTNY131G747VFD4ZBDIKTNA0B11YB9R75
Output for 5.5.6
J8PB6811GKRQGZGS7I8G22M983G8KQW8KL3WUJLU8H58EYKVLCEV8L4EC9IW
Output for 5.5.5
NV8BE0FCWPT5MVUEVTR5Y3PLI5ZW87JU9XW8JE59LOLKNL6DHD0JVMQLXGAR
Output for 5.5.4
Q05DBCQF2ZO7P0KOOAIFVXSDJ6MWZ92Y6PV5A5SYUWGQ9MDJ9REWPZJ101RY
Output for 5.5.3
1T8BAHTE0HLPDGHYM1GOX27UDPCGNDRT68KNV8GKBGDP4S82CIR0QNEQCFYJ
Output for 5.5.2
5NTKEDBNWNK9XSU5ID0F0365S79MKXC8H6AADXPTV8XLD43AOXCJEKHU21PV
Output for 5.5.1
91SYM2ZWUDWEAP0G51KPL3WNCY5QZ3G1ZVOFI5A5PEQ7GNQ4O3LDJILYOHSJ
Output for 5.5.0
FUI4149XB92L6V8XA7IABYGMA7MOGQIME58KN1QT1Q88GUUEJ8LGEJJEK30R
Output for 5.4.45
ZBODBYLE31FIHF1KEVCFNV0E81CQQJUBK3P4LKH4OH2C3FQ43NIVOQBNL0XK
Output for 5.4.44
ZQX5C8KJ9JVER89KFJTZ75FBI2MGG69MWVNF9KAWI17VZE0ED2B79JPT13YS
Output for 5.4.43
8J0D2IOSTV52AK00XRVEIRY1ETGAWS1183RZIYE2OYCHKPGQ1HFX2RU11ICW
Output for 5.4.42
J6OU2DOGFAMEUTMA3XW8RKZRVEN0QPOWNM0GLAKY0I1N5MD7C7CDILMBBN1Z
Output for 5.4.41
6OH3L4DVDH4H631I9Q9TO41V7TSC740OXLRCTLLUGZEM05WZ0V9J0Y7Y7OZE
Output for 5.4.40
QPXRQQM82I911ZZURDQI2MN9L3VGB4QYTPYQEKFAPYR1Y7TBRMQEE6F80LRN
Output for 5.4.39
1FQP4H6HCQ806SBLWPJLM0DTUUMZ39H86MUF2P1YJUP6E0D3FLU2VDOWBQUJ
Output for 5.4.38
A2BHQG52XS60NC3APNCCC5G3AGY65I88VIVDIG8X7WZKFCPI3C54LNLIKV1M
Output for 5.4.37
YRNKBUFKCFCH78JEY2BKIPUW2AKF9CNF1V2W5QBC43A6YZBICPFHU461UAUN
Output for 5.4.36
AXTZFTE83W5BBYRBHP53TC9ZM72RGXMT52PGZ4Y6S7PBFUQN8LS5PG7HN0NT
Output for 5.4.35
M6YDRWLY5YP1X6DXQXFUHH7UEL23HUS5DHPNK0AARY8RMPBGI2B3L4DT2C8H
Output for 5.4.34
D256X4JOZMOBJW4YUGDUI49FOBRO2W757MDLIZG9MVVH2OIAXQB7N7XHT3GU
Output for 5.4.32
QT5RJNE8FR8KURXG5T0SW2JRBICD5LWMW7UEY3PS5RZ7ETILHFC8ZAGWSV39
Output for 5.4.31
7HYVGRH3V715RSGI95B7SCXPWQ9YNEF3K4ITB8R8K18M5AAXK727PLOWOPZE
Output for 5.4.30
3I6URTF98XCFWKNCMJG6HG4QRRQT1AC4DELZD6LY5FIEJQPQ9BLQ41H4G7GO
Output for 5.4.29
AVG0A1Z8PEYH8KVF97JJNDT005YZKFUFPWVK4WG5MDDWBDBHYI61S522BNJ2
Output for 5.4.28
2O7LC7TTVS6EMJK1FE1ZQFW2FDAR605834X6GC7G9TAKZ284RE55YV14MMO4
Output for 5.4.27
XYJSBNYJSVZCCINHRLQA59CQ3QN2FR5AV129958FWY3JXEZ1B31R9QDZE4UH
Output for 5.4.26
6TCFQZJTSCSI5TF15DBSV8CMIY8AESM57PFN6R24AC9N5OK6A5MCBZP1L64T
Output for 5.4.25
3NGRZSEFIGWQCQPK9G7ZFEWJCPCM86FMKF9U0ZBTIN2UTRL5ZT1ESKHJ529D
Output for 5.4.24
APJWJO1YINYI94Y9XBK7HWT2O45BTB9PSFWWRVUXLEMQHA81UH0NELBPTFQA
Output for 5.4.23
KRIIGVUSAI4PJSG4GGYBZ9CZSY2M3QJ08WCG2G81VYYRZECZZJHCKOIHE025
Output for 5.4.22
17IQ0ESP7KSPTFY04C2K71D88O98FFSS7DO9S8NFFQ368WHA5LRZP5R3T7GR
Output for 5.4.21
LEPMBIHB1FXAJ9GOUYTKD50QNZ71FHZVJ6NY68M6K0VRSOCI9YM8T1XDVXPA
Output for 5.4.20
0TN1SI281QDNN7BYOS1WLDWKTUJMAPXC6GKWG3JN20VCKMZFHVP8SX0NZYF4
Output for 5.4.19
EAZXOETHY1Y16CPX4XJR39EBSE3THFBJWDWHAZCS9OX7915JMR5HH37XBYXX
Output for 5.4.18
HKD5M7MXOW4BZGC6WUGKCXXSHV48QSZZJO4ET6ABYNTXDQKW0WR5MKSEVMD2
Output for 5.4.17
O9EXGS6P1LCEKXOOQMOB8GFVIQPNVLO3DSCGSWT2CIKKZK80CX6DJ3X5PB0S
Output for 5.4.16
KO2O8AWCI26TQ4BFAFV405HC393SIM4SBO3B98AYO90K9K9ADJUVZK1ZMOFZ
Output for 5.4.15
9XU7IKFCXKWGFV9838XL1YVUL9JTKCI7A2DZD1R7FDZIGNP0PB4C1YILOY3E
Output for 5.0.0 - 5.4.14
Fatal error: Call to undefined function openssl_random_pseudo_bytes() in /in/QaKOJ on line 10
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: openssl_random_pseudo_bytes() in /in/QaKOJ on line 10
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: openssl_random_pseudo_bytes() in /in/QaKOJ on line 10
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: openssl_random_pseudo_bytes() in /in/QaKOJ on line 10