3v4l.org

run code in 300+ PHP versions simultaneously
<?php $server_seed = "wD1Npmkxz0pTsHXNLojXIoG9DMTxiACRyuHQVkiJCt2wbTR9r8QBfKo1fh8SwhFn"; $public_seed = "676406627421"; $round = "2257"; $hash = hash('sha256', $server_seed . "-" . $public_seed . "-" . $round); $roll = hexdec(substr($hash, 0, 8)) % 29; if ($roll >= 15) $roll = $roll - 10; if ($roll >= 15) $roll = $roll - 10; if ($roll == 0) $roll_colour = 'gold'; elseif ($roll % 2 === 1) $roll_colour = 'black'; elseif ($roll % 2 === 0) $roll_colour = 'red'; echo("Roll: $roll\nColour: $roll_colour");
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 24, Position 2 = 26
Branch analysis from position: 24
2 jumps found. (Code = 43) Position 1 = 28, Position 2 = 30
Branch analysis from position: 28
2 jumps found. (Code = 43) Position 1 = 32, Position 2 = 34
Branch analysis from position: 32
1 jumps found. (Code = 42) Position 1 = 43
Branch analysis from position: 43
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 34
2 jumps found. (Code = 43) Position 1 = 37, Position 2 = 39
Branch analysis from position: 37
1 jumps found. (Code = 42) Position 1 = 43
Branch analysis from position: 43
Branch analysis from position: 39
2 jumps found. (Code = 43) Position 1 = 42, Position 2 = 43
Branch analysis from position: 42
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 43
Branch analysis from position: 30
Branch analysis from position: 26
filename:       /in/Ag4DT
function name:  (null)
number of ops:  49
compiled vars:  !0 = $server_seed, !1 = $public_seed, !2 = $round, !3 = $hash, !4 = $roll, !5 = $roll_colour
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'wD1Npmkxz0pTsHXNLojXIoG9DMTxiACRyuHQVkiJCt2wbTR9r8QBfKo1fh8SwhFn'
    3     1        ASSIGN                                                   !1, '676406627421'
    4     2        ASSIGN                                                   !2, '2257'
    5     3        INIT_FCALL                                               'hash'
          4        SEND_VAL                                                 'sha256'
          5        CONCAT                                           ~9      !0, '-'
          6        CONCAT                                           ~10     ~9, !1
          7        CONCAT                                           ~11     ~10, '-'
          8        CONCAT                                           ~12     ~11, !2
          9        SEND_VAL                                                 ~12
         10        DO_ICALL                                         $13     
         11        ASSIGN                                                   !3, $13
    6    12        INIT_FCALL                                               'hexdec'
         13        INIT_FCALL                                               'substr'
         14        SEND_VAR                                                 !3
         15        SEND_VAL                                                 0
         16        SEND_VAL                                                 8
         17        DO_ICALL                                         $15     
         18        SEND_VAR                                                 $15
         19        DO_ICALL                                         $16     
         20        MOD                                              ~17     $16, 29
         21        ASSIGN                                                   !4, ~17
    7    22        IS_SMALLER_OR_EQUAL                                      15, !4
         23      > JMPZ                                                     ~19, ->26
    8    24    >   SUB                                              ~20     !4, 10
         25        ASSIGN                                                   !4, ~20
    9    26    >   IS_SMALLER_OR_EQUAL                                      15, !4
         27      > JMPZ                                                     ~22, ->30
   10    28    >   SUB                                              ~23     !4, 10
         29        ASSIGN                                                   !4, ~23
   11    30    >   IS_EQUAL                                                 !4, 0
         31      > JMPZ                                                     ~25, ->34
         32    >   ASSIGN                                                   !5, 'gold'
         33      > JMP                                                      ->43
   12    34    >   MOD                                              ~27     !4, 2
         35        IS_IDENTICAL                                             ~27, 1
         36      > JMPZ                                                     ~28, ->39
         37    >   ASSIGN                                                   !5, 'black'
         38      > JMP                                                      ->43
   13    39    >   MOD                                              ~30     !4, 2
         40        IS_IDENTICAL                                             ~30, 0
         41      > JMPZ                                                     ~31, ->43
         42    >   ASSIGN                                                   !5, 'red'
   14    43    >   ROPE_INIT                                     4  ~34     'Roll%3A+'
         44        ROPE_ADD                                      1  ~34     ~34, !4
         45        ROPE_ADD                                      2  ~34     ~34, '%0AColour%3A+'
         46        ROPE_END                                      3  ~33     ~34, !5
         47        ECHO                                                     ~33
         48      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.52 ms | 1466 KiB | 16 Q