3v4l.org

run code in 300+ PHP versions simultaneously
<?php $server_seed = "7"; $public_seed = "2322162717"; $round = "9008567"; $hash = hash('sha256', $server_seed . "-" . $public_seed . "-" . $round); $roll = hexdec(substr($hash, 0, 8)) % 15; if ($roll == 0) $roll_colour = 'bonus'; elseif ($roll >= 1 and $roll <= 7) $roll_colour = 'orange'; elseif ($roll >= 8 and $roll <= 14) $roll_colour = 'black'; echo("Roll: $roll\nColour: $roll_colour\n\n"); $randseed = random_bytes(16); echo(strlen($randseed) . "\n"); var_dump($randseed); var_dump(bin2hex($randseed));
Output for 8.2.11
Roll: 12 Colour: black 16 string(16) "������^�-����m�" string(32) "8584f7fa92e35ef92dcedddef9a16d86"
Output for 8.2.10
Roll: 12 Colour: black 16 string(16) "*��ݥ8�M��l" string(32) "2a05f183cf1fdda538a44d13aebf6c07"
Output for 8.2.9
Roll: 12 Colour: black 16 string(16) "���l2y� �2�ꅬ�Y" string(32) "9bcfef6c32798c0afd32c3ea85acf159"
Output for 8.2.8
Roll: 12 Colour: black 16 string(16) "��3�n���ˈ���" string(32) "d1f8ef33a8036ee6b6eac5cb88a5fdf5"
Output for 8.2.7
Roll: 12 Colour: black 16 string(16) "�i��=*�x�3 FDy1" string(32) "c66991f53d1b2abe78dd330a46447931"
Output for 8.2.6
Roll: 12 Colour: black 16 string(16) "�E§����*=���OF" string(32) "9445c2a7b1b5d3ed2a3daa9ab84f4617"
Output for 8.2.5
Roll: 12 Colour: black 16 string(16) "�c�,=�{���bc� �" string(32) "cb63e2192c3de77bebeee96263930995"
Output for 8.2.4
Roll: 12 Colour: black 16 string(16) "KuC;�fui&�2�," string(32) "4b75433bfe66756907260ead7f32b52c"
Output for 8.2.3
Roll: 12 Colour: black 16 string(16) "����zl���6�B�" string(32) "a8ee1b9df47a6c84fe15b636bd428702"
Output for 8.2.2
Roll: 12 Colour: black 16 string(16) "K1rH'`w2��Z�7" string(32) "4b317248276077320e06a6c6f85a9b37"
Output for 8.2.1
Roll: 12 Colour: black 16 string(16) "���Ri[�4�!�Q�y" string(32) "e2ffd4ed52695bb7348621d951d97906"
Output for 8.2.0
Roll: 12 Colour: black 16 string(16) "�8��p�Ģ��y�*" string(32) "c43806cb1cd9fb70d9c4a2a6ff798e2a"
Output for 8.1.24
Roll: 12 Colour: black 16 string(16) "��K�" b��i�O��" string(32) "d3f14bebfa22090262bbbe698e4fdada"
Output for 8.1.23
Roll: 12 Colour: black 16 string(16) "G����J�ޯ�eV���]" string(32) "4786dceede4adfdeafb46556c0b1e15d"
Output for 8.1.22
Roll: 12 Colour: black 16 string(16) "r����ea��~��" string(32) "1872f59c9a08f365611db4b07ec50899"
Output for 8.1.21
Roll: 12 Colour: black 16 string(16) "d��C|$�EC��0}�" string(32) "64b40fbb437c24af4543e4e7307d13c5"
Output for 8.1.20
Roll: 12 Colour: black 16 string(16) "�a�;v7gۡfǢ`�" string(32) "fd618e3b76376711dba166c7a26010a5"
Output for 8.1.19
Roll: 12 Colour: black 16 string(16) "`}�q���@8̠W" string(32) "607d8b71c3068eeebd4038cca0175714"
Output for 8.1.18
Roll: 12 Colour: black 16 string(16) "�'B�5�"`���" string(32) "a42742e2023511dd221a056089ff890e"
Output for 8.1.17
Roll: 12 Colour: black 16 string(16) "|VJ)��ƭ5�L� �*" string(32) "7c56184a2986a1c6ad35bb4c820d972a"
Output for 8.1.16
Roll: 12 Colour: black 16 string(16) "�HU�talp��W�(I+" string(32) "844855a51274616c70ddf357a628492b"
Output for 8.1.15
Roll: 12 Colour: black 16 string(16) "��|��6d\���x���D" string(32) "f6f87c85f836645cfaa68478ab97a144"
Output for 8.1.14
Roll: 12 Colour: black 16 string(16) "��O�����9��n��3" string(32) "aedd4f9019a3d0c9ed39b4bc6e8db833"
Output for 8.1.13
Roll: 12 Colour: black 16 string(16) "�WG�1���F��� " string(32) "fd5747db1331c0d9ee46d0acc8e4c50b"
Output for 8.1.12
Roll: 12 Colour: black 16 string(16) "5�����������t" string(32) "35df08a4b1c217acb414bfebe5e6e274"
Output for 8.1.11
Roll: 12 Colour: black 16 string(16) "�u�1Q� @�=M�P�8" string(32) "ba75a7315114b60940fa3d4dac50b238"
Output for 8.1.10
Roll: 12 Colour: black 16 string(16) "���/G��ׯh��[d<�" string(32) "9d9d8d2f47a3dad7af68cdd25b643ceb"
Output for 8.1.9
Roll: 12 Colour: black 16 string(16) "�-|���fclv��F=�" string(32) "ee2d7ccbdef466636c76aaa616463dd2"
Output for 8.1.8
Roll: 12 Colour: black 16 string(16) "�|�Q�K\�1@��Q" string(32) "b77c895116994b5cd13140991daa5105"
Output for 8.1.7
Roll: 12 Colour: black 16 string(16) "��"�E�z!���(�" string(32) "9208ec221f02f045ad7a218a95d928c8"
Output for 8.1.6
Roll: 12 Colour: black 16 string(16) "!>D���nگ]��6"" string(32) "04213e44a703f9a16edaaf5da8993622"
Output for 8.1.5
Roll: 12 Colour: black 16 string(16) "Mt�(��ULjP��Q�{" string(32) "4d74c728dcd4554c6a50c1d6f651cd7b"
Output for 8.1.4
Roll: 12 Colour: black 16 string(16) "༞��`��ț� �{" string(32) "e0bc9e9304d360ef9acac89ba509ad7b"
Output for 8.1.3
Roll: 12 Colour: black 16 string(16) "�J��>~�L�{��� h" string(32) "a51b4af4c73e7e804caa7b9097fc0d68"
Output for 8.1.2
Roll: 12 Colour: black 16 string(16) "��bW_��4 �%ɮ." string(32) "efc662575ff8a8340af381251dc9ae2e"
Output for 8.1.1
Roll: 12 Colour: black 16 string(16) "#V~�އ-�a8��� '?" string(32) "23567ecade872da96138bcb38120273f"
Output for 8.1.0
Roll: 12 Colour: black 16 string(16) "�.l��<�ν&(�-lb" string(32) "c72e6cfcf73ca6cebd2628b02d6c0662"
Output for 8.0.30
Roll: 12 Colour: black 16 string(16) "��Sr��}��bs�" string(32) "af1204b15372fcd5f5037dd8ee6273ff"
Output for 8.0.29
Roll: 12 Colour: black 16 string(16) "�cm��c�vuuK*X" string(32) "9000636da3f363831a7675754b2a581a"
Output for 8.0.28
Roll: 12 Colour: black 16 string(16) "q�p�M(g���_��" string(32) "71f570911c4d1028679bacd05feefed7"
Output for 8.0.27
Roll: 12 Colour: black 16 string(16) "6<T@> ����\�f&�" string(32) "363c54403e0dab8883e25c15a466268e"
Output for 8.0.26
Roll: 12 Colour: black 16 string(16) "`�����Z�!M�v" string(32) "1560bbc407a0f08ada5ae8214d9c1976"
Output for 8.0.25
Roll: 12 Colour: black 16 string(16) "&�M��6�����N�" string(32) "7f26924df901bb0736938c9cefc94ea9"
Output for 8.0.24
Roll: 12 Colour: black 16 string(16) "$� 页S� �=x�" string(32) "24d20ce9a1b553fb170aaa1a3d7803e3"
Output for 8.0.23
Roll: 12 Colour: black 16 string(16) "��E0��Yy�2�h��" string(32) "bd03e6453085d85979f132d00668b6d9"
Output for 8.0.22
Roll: 12 Colour: black 16 string(16) "�{��~~F:3z�to�W" string(32) "bd7b86e77e7e463a337a84746fc01357"
Output for 8.0.21
Roll: 12 Colour: black 16 string(16) "UTq�5*���oSr�" string(32) "551f5471e716352ac21399cd6f53729f"
Output for 8.0.20
Roll: 12 Colour: black 16 string(16) "��WJ89*D�mU�e��" string(32) "b09b574a1838392a44e86d559e6591db"
Output for 8.0.19
Roll: 12 Colour: black 16 string(16) "b�nV�0�3泳Z���f" string(32) "62da6e56ae309033e6b3b35acef1ce66"
Output for 8.0.18
Roll: 12 Colour: black 16 string(16) " �l���r��n�" string(32) "0b986c14baa3a31b72d0a81ebca46eb2"
Output for 8.0.17
Roll: 12 Colour: black 16 string(16) "$�Hƣ�R���ȕ$��" string(32) "24a248c6a3db52c5ce0f84c89524c7d1"
Output for 8.0.16
Roll: 12 Colour: black 16 string(16) "�a$�i5:���Z3}�)�" string(32) "ba61249169353aa2feb15a337da029e1"
Output for 8.0.15
Roll: 12 Colour: black 16 string(16) "�6}?�@u��\R���j" string(32) "da367d3fe7934075b3f55c52bad7e46a"
Output for 8.0.14
Roll: 12 Colour: black 16 string(16) "��_��r�J�*j�" string(32) "dcf25f19191df2a5e972ae4ad62a6ad1"
Output for 8.0.13
Roll: 12 Colour: black 16 string(16) "�˲=;����E���\" string(32) "decbb23d3b85c9fe89da459c88e1125c"
Output for 8.0.12
Roll: 12 Colour: black 16 string(16) "--��� ��6&�w����" string(32) "2d2d8a9ced098fda3626d277b8a7c9d5"
Output for 8.0.11
Roll: 12 Colour: black 16 string(16) "��t:�4���?���" string(32) "f4a5dd743aff1a34fa8eee3f00a2fdcb"
Output for 8.0.10
Roll: 12 Colour: black 16 string(16) "�Z"�.R�Dxv��B" string(32) "905a0f22f32e52e1447876dd1aed4200"
Output for 8.0.9
Roll: 12 Colour: black 16 string(16) "�\�FD���d�" string(32) "0707cb5ceeb7bdee9b46449c8c8364ca"
Output for 8.0.8
Roll: 12 Colour: black 16 string(16) "v�3�ZT;2�4J��ֆ" string(32) "0876d033dc5a543b32b7344acec2d686"
Output for 8.0.7
Roll: 12 Colour: black 16 string(16) "���Ž�Ҽ(b50U"" string(32) "82dee21c0fc28ea6d2bc286235305522"
Output for 8.0.6
Roll: 12 Colour: black 16 string(16) "�N�ɫy��^���ʢ" string(32) "e94ee3c9ab79bb9d065eac9be4aacaa2"
Output for 8.0.5
Roll: 12 Colour: black 16 string(16) "$���Hۤ�I-� ��" string(32) "24bdbfbc0548dba4eb492d18ca20d0dd"
Output for 8.0.3
Roll: 12 Colour: black 16 string(16) "I�<J��u� ���j�" string(32) "49f53c4ae600b575bf0cbbb4a66aa604"
Output for 8.0.2
Roll: 12 Colour: black 16 string(16) "�r}2[1-��bT��;"�" string(32) "de727d325b312d9e826254baa63b2293"
Output for 8.0.1
Roll: 12 Colour: black 16 string(16) "D?�&T ���iw��e" string(32) "443fc126541420c9e0df6977cec8651e"

preferences:
64.28 ms | 402 KiB | 71 Q