3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
170 ms | 1527 KiB | 15 Q