3v4l.org

run code in 300+ 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 = 25, Position 2 = 27
Branch analysis from position: 25
1 jumps found. (Code = 42) Position 1 = 44
Branch analysis from position: 44
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 27
2 jumps found. (Code = 43) Position 1 = 29, Position 2 = 31
Branch analysis from position: 29
1 jumps found. (Code = 42) Position 1 = 44
Branch analysis from position: 44
Branch analysis from position: 31
2 jumps found. (Code = 43) Position 1 = 33, Position 2 = 35
Branch analysis from position: 33
1 jumps found. (Code = 42) Position 1 = 44
Branch analysis from position: 44
Branch analysis from position: 35
2 jumps found. (Code = 43) Position 1 = 38, Position 2 = 40
Branch analysis from position: 38
1 jumps found. (Code = 42) Position 1 = 44
Branch analysis from position: 44
Branch analysis from position: 40
2 jumps found. (Code = 43) Position 1 = 43, Position 2 = 44
Branch analysis from position: 43
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 44
filename:       /in/dpNeO
function name:  (null)
number of ops:  50
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        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, 15
         21        ADD                                              ~18     ~17, 1
         22        ASSIGN                                                   !4, ~18
    8    23        IS_EQUAL                                                 !4, 1
         24      > JMPZ                                                     ~20, ->27
         25    >   ASSIGN                                                   !5, 'gold'
         26      > JMP                                                      ->44
    9    27    >   IS_EQUAL                                                 !4, 2
         28      > JMPZ                                                     ~22, ->31
         29    >   ASSIGN                                                   !5, 'blackbait'
         30      > JMP                                                      ->44
   10    31    >   IS_EQUAL                                                 !4, 15
         32      > JMPZ                                                     ~24, ->35
         33    >   ASSIGN                                                   !5, 'redbait'
         34      > JMP                                                      ->44
   11    35    >   MOD                                              ~26     !4, 2
         36        IS_EQUAL                                                 ~26, 1
         37      > JMPZ                                                     ~27, ->40
         38    >   ASSIGN                                                   !5, 'red'
         39      > JMP                                                      ->44
   12    40    >   MOD                                              ~29     !4, 2
         41        IS_EQUAL                                                 ~29, 0
         42      > JMPZ                                                     ~30, ->44
         43    >   ASSIGN                                                   !5, 'black'
   14    44    >   ROPE_INIT                                     4  ~33     'Roll%3A+'
         45        ROPE_ADD                                      1  ~33     ~33, !4
         46        ROPE_ADD                                      2  ~33     ~33, '%0AColour%3A+'
         47        ROPE_END                                      3  ~32     ~33, !5
         48        ECHO                                                     ~32
         49      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.27 ms | 1017 KiB | 16 Q