3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $y = new stdClass; $x = bin2hex(random_bytes(16)); $y->token = $x; var_dump(json_encode($y));
based on ScujO
Output for 7.2.6
string(44) "{"token":"a50560bf28c8c531b05cb9181300d5ff"}"
Output for 7.2.0
string(44) "{"token":"fa38f3afa1a470974e3966f59a103ff1"}"
Output for 7.1.10
string(44) "{"token":"42dcce8c4282ba134164a1bc83fd0cc5"}"
Output for 7.1.7
string(44) "{"token":"8b78b60898ccc049c32096b26b01a46b"}"
Output for 7.1.6
string(44) "{"token":"f0e516bd61de4cb46dea0d4e468d3b21"}"
Output for 7.1.5
string(44) "{"token":"4412b57557f3cd2c63a178e2f1ab9bb1"}"
Output for 7.1.4
string(44) "{"token":"404424a441cd496389d27308c6b951da"}"
Output for 7.1.3
string(44) "{"token":"340e6871fefe67a57968e8923bcd3dfd"}"
Output for 7.1.2
string(44) "{"token":"7d7d99e87ef5aae1b7cd85e3d35d6b61"}"
Output for 7.1.1
string(44) "{"token":"a4f41eda54b2e152f21bbe63c27881f3"}"
Output for 7.1.0
string(44) "{"token":"4fe8c1cfb943272fa6718cfec2644899"}"
Output for 7.0.20
string(44) "{"token":"55a976e1ceac241cfdab8762e2fba0af"}"
Output for 7.0.19
string(44) "{"token":"4c1665316d3b7c5ce93b9684e9c3a84b"}"
Output for 7.0.18
string(44) "{"token":"327eefe03a18f2b3eabe0c552c92ebb8"}"
Output for 7.0.17
string(44) "{"token":"a6a4085999e15f79036f219d7a1c9f0a"}"
Output for 7.0.16
string(44) "{"token":"04bc333ee1079e8cd087ade78fd20bc0"}"
Output for 7.0.15
string(44) "{"token":"1606ea36f22ce38e70ce1ce08f50bcdc"}"
Output for 7.0.14
string(44) "{"token":"7c29d7d926de2b6206eeedb22b8de3b2"}"
Output for 7.0.13
string(44) "{"token":"062c8eeeb3d01393094fe4a4e4a2f275"}"
Output for 7.0.12
string(44) "{"token":"dd7732e02cf8ea678b1fe37214cd7783"}"
Output for 7.0.11
string(44) "{"token":"8a43467667875704e18c1fd1e580a0db"}"
Output for 7.0.10
string(44) "{"token":"b308f7716b7d6400df6df543168fe7f3"}"
Output for 7.0.9
string(44) "{"token":"7d34b03a73fb50e8c9c5aeaac8a250f2"}"
Output for 7.0.8
string(44) "{"token":"aae6218fd307edad9235c1683e606ba1"}"
Output for 7.0.7
string(44) "{"token":"0fa6b747289eb594a936b5a04aac5a75"}"
Output for 7.0.6
string(44) "{"token":"eaaa65873c520f96559391dc665954ff"}"
Output for 7.0.5
string(44) "{"token":"06e4dde2d8772433c85ea6370f77539a"}"
Output for 7.0.4
string(44) "{"token":"ee9bcdc2628a3eb6787cede6d6838737"}"
Output for 7.0.3
string(44) "{"token":"c896f1d43133f87076542c0325a123fe"}"
Output for 7.0.2
string(44) "{"token":"d116b7fb013d3056a23a4fa13a59293e"}"
Output for 7.0.1
string(44) "{"token":"7d02c555222d140da6ef25add394a879"}"
Output for 7.0.0
string(44) "{"token":"7cbf9133c0d3bc7ec640992d08e36dfa"}"
Output for hhvm-3.15.4
string(44) "{"token":"1da3b01de9962525b5950baeb1b93e04"}"
Output for 5.6.0 - 5.6.30
Fatal error: Call to undefined function random_bytes() in /in/ZcjKL on line 4
Process exited with code 255.