3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $x['token'] = bin2hex(random_bytes(16)); var_dump(json_encode($x));
based on jpdk0
Output for 7.2.6
string(44) "{"token":"f78d2da06075e7b86fb46825eb25893f"}"
Output for 7.2.0
string(44) "{"token":"a05b99048f64e75334edad17903f8da7"}"
Output for 7.1.10
string(44) "{"token":"5a83efbb7dfe068b73c0c4a01c2041d0"}"
Output for 7.1.7
string(44) "{"token":"f1e397ff544508fe648f6ff6529717d4"}"
Output for 7.1.6
string(44) "{"token":"0e04d41ce368e4251c32c7ba3aa558c4"}"
Output for 7.1.5
string(44) "{"token":"80096a5e4661e1c86cdf025cae5124b4"}"
Output for 7.1.4
string(44) "{"token":"51ec8c886882703ca6b2e7896723f881"}"
Output for 7.1.3
string(44) "{"token":"4c4e49c2fcf24db3af2321a81c36ab7d"}"
Output for 7.1.2
string(44) "{"token":"b618069c195a4e23b22a8037823b4ac5"}"
Output for 7.1.1
string(44) "{"token":"3bee177503e4739399e7574e1895e23f"}"
Output for 7.1.0
string(44) "{"token":"ea5aeac4a5bea204c9b0bc171a5d291b"}"
Output for 7.0.20
string(44) "{"token":"bf9c6cf117177b6d2997eb1e25724db5"}"
Output for 7.0.19
string(44) "{"token":"645618dee44bdef751aeaa22a2e033aa"}"
Output for 7.0.18
string(44) "{"token":"79448a4a5df57f4b1a35997672b868cf"}"
Output for 7.0.17
string(44) "{"token":"b4c6ef2a8dd43f9411b472f00d96a5cf"}"
Output for 7.0.16
string(44) "{"token":"02aded9455fa4708fb56cd35050cd113"}"
Output for 7.0.15
string(44) "{"token":"5da52f1482ce0ee7fde5e806106204cf"}"
Output for 7.0.14
string(44) "{"token":"6fb6843f7dcf8457d9b9ea230eb44103"}"
Output for 7.0.13
string(44) "{"token":"b6b893de509fd747770760215cdcf1c2"}"
Output for 7.0.12
string(44) "{"token":"e2633c956604f17af2945e6b245dba79"}"
Output for 7.0.11
string(44) "{"token":"a3370645800518c73da6154b3d71b10f"}"
Output for 7.0.10
string(44) "{"token":"6d2d41fc655711e4ee4513bef6b11479"}"
Output for 7.0.9
string(44) "{"token":"448b81329f5cbf10cbf80f73440c91fb"}"
Output for 7.0.8
string(44) "{"token":"29c5cf1198617b4775c49b46ed81cf2e"}"
Output for 7.0.7
string(44) "{"token":"34672abc14a6e03780efe5ec3b2ff6a1"}"
Output for 7.0.6
string(44) "{"token":"0be35d474dc82d7244a9419627d02acc"}"
Output for 7.0.5
string(44) "{"token":"1aa6f4352516e5a45dc5365c24528f22"}"
Output for 7.0.4
string(44) "{"token":"c60396b10809bcd30ffbd11048893fc7"}"
Output for 7.0.3
string(44) "{"token":"243fca4f70840787ff53b9fe4408f922"}"
Output for 7.0.2
string(44) "{"token":"8cb0b98d931e8bf8617793502324020d"}"
Output for 7.0.1
string(44) "{"token":"0e4aa65d189f3ef01e3e67123bfca766"}"
Output for 7.0.0
string(44) "{"token":"bf8475bab2e8225e1a7c193d554e2095"}"
Output for hhvm-3.15.4
string(44) "{"token":"5b7211fdde4e1e6e5b264b5bc5f5866e"}"
Output for 5.6.0 - 5.6.30
Fatal error: Call to undefined function random_bytes() in /in/tWeJ8 on line 2
Process exited with code 255.