3v4l.org

run code in 300+ PHP versions simultaneously
<?php $game_id = 47399; $private_seed = "969e82ae0b4a3cfd6bf2afea5cf8bd26ddc6c11f3ae676f5655e779607b3778f"; $public_seed = "076c26818441622607ad1bffbf5f02a90eaadb020532bda9a9d60aedfb217528"; $hash = hash("sha256", $private_seed . '-' . $public_seed . '-' . $game_id); $flip = hexdec(substr($hash, 0, 8)) % 2 + 1; echo "Server seed hash: " . hash("sha256", $private_seed) . "\n"; echo "Result: " . ($flip == 1 ? 'RED' : 'BLACK');
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 32, Position 2 = 34
Branch analysis from position: 32
1 jumps found. (Code = 42) Position 1 = 35
Branch analysis from position: 35
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 34
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0T9bJ
function name:  (null)
number of ops:  38
compiled vars:  !0 = $game_id, !1 = $private_seed, !2 = $public_seed, !3 = $hash, !4 = $flip
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 47399
    3     1        ASSIGN                                                   !1, '969e82ae0b4a3cfd6bf2afea5cf8bd26ddc6c11f3ae676f5655e779607b3778f'
    4     2        ASSIGN                                                   !2, '076c26818441622607ad1bffbf5f02a90eaadb020532bda9a9d60aedfb217528'
    5     3        INIT_FCALL                                               'hash'
          4        SEND_VAL                                                 'sha256'
          5        CONCAT                                           ~8      !1, '-'
          6        CONCAT                                           ~9      ~8, !2
          7        CONCAT                                           ~10     ~9, '-'
          8        CONCAT                                           ~11     ~10, !0
          9        SEND_VAL                                                 ~11
         10        DO_ICALL                                         $12     
         11        ASSIGN                                                   !3, $12
    6    12        INIT_FCALL                                               'hexdec'
         13        INIT_FCALL                                               'substr'
         14        SEND_VAR                                                 !3
         15        SEND_VAL                                                 0
         16        SEND_VAL                                                 8
         17        DO_ICALL                                         $14     
         18        SEND_VAR                                                 $14
         19        DO_ICALL                                         $15     
         20        MOD                                              ~16     $15, 2
         21        ADD                                              ~17     ~16, 1
         22        ASSIGN                                                   !4, ~17
    8    23        INIT_FCALL                                               'hash'
         24        SEND_VAL                                                 'sha256'
         25        SEND_VAR                                                 !1
         26        DO_ICALL                                         $19     
         27        CONCAT                                           ~20     'Server+seed+hash%3A+', $19
         28        CONCAT                                           ~21     ~20, '%0A'
         29        ECHO                                                     ~21
   10    30        IS_EQUAL                                                 !4, 1
         31      > JMPZ                                                     ~22, ->34
         32    >   QM_ASSIGN                                        ~23     'RED'
         33      > JMP                                                      ->35
         34    >   QM_ASSIGN                                        ~23     'BLACK'
         35    >   CONCAT                                           ~24     'Result%3A+', ~23
         36        ECHO                                                     ~24
         37      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
133.43 ms | 955 KiB | 16 Q