3v4l.org

run code in 300+ PHP versions simultaneously
<?php $server_seed = "beb83c000e115e9944606f8e1b74b3a7e73ef99bb4896389ae2930b37307d771"; $public_seed = "3329391827"; $round = "6175260"; $hash = unhashed('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");
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 24, Position 2 = 26
Branch analysis from position: 24
1 jumps found. (Code = 42) Position 1 = 39
Branch analysis from position: 39
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 26
2 jumps found. (Code = 46) Position 1 = 28, Position 2 = 30
Branch analysis from position: 28
2 jumps found. (Code = 43) Position 1 = 31, Position 2 = 33
Branch analysis from position: 31
1 jumps found. (Code = 42) Position 1 = 39
Branch analysis from position: 39
Branch analysis from position: 33
2 jumps found. (Code = 46) Position 1 = 35, Position 2 = 37
Branch analysis from position: 35
2 jumps found. (Code = 43) Position 1 = 38, Position 2 = 39
Branch analysis from position: 38
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 39
Branch analysis from position: 37
Branch analysis from position: 30
filename:       /in/ospfs
function name:  (null)
number of ops:  45
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
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'beb83c000e115e9944606f8e1b74b3a7e73ef99bb4896389ae2930b37307d771'
    4     1        ASSIGN                                                   !1, '3329391827'
    5     2        ASSIGN                                                   !2, '6175260'
    6     3        INIT_FCALL_BY_NAME                                       'unhashed'
          4        SEND_VAL_EX                                              'sha256'
          5        CONCAT                                           ~9      !0, '-'
          6        CONCAT                                           ~10     ~9, !1
          7        CONCAT                                           ~11     ~10, '-'
          8        CONCAT                                           ~12     ~11, !2
          9        SEND_VAL_EX                                              ~12
         10        DO_FCALL                                      0  $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        ASSIGN                                                   !4, ~17
    8    22        IS_EQUAL                                                 !4, 0
         23      > JMPZ                                                     ~19, ->26
         24    >   ASSIGN                                                   !5, 'bonus'
         25      > JMP                                                      ->39
    9    26    >   IS_SMALLER_OR_EQUAL                              ~21     1, !4
         27      > JMPZ_EX                                          ~21     ~21, ->30
         28    >   IS_SMALLER_OR_EQUAL                              ~22     !4, 7
         29        BOOL                                             ~21     ~22
         30    > > JMPZ                                                     ~21, ->33
         31    >   ASSIGN                                                   !5, 'orange'
         32      > JMP                                                      ->39
   10    33    >   IS_SMALLER_OR_EQUAL                              ~24     8, !4
         34      > JMPZ_EX                                          ~24     ~24, ->37
         35    >   IS_SMALLER_OR_EQUAL                              ~25     !4, 14
         36        BOOL                                             ~24     ~25
         37    > > JMPZ                                                     ~24, ->39
         38    >   ASSIGN                                                   !5, 'black'
   12    39    >   ROPE_INIT                                     4  ~28     'Roll%3A+'
         40        ROPE_ADD                                      1  ~28     ~28, !4
         41        ROPE_ADD                                      2  ~28     ~28, '%0AColour%3A+'
         42        ROPE_END                                      3  ~27     ~28, !5
         43        ECHO                                                     ~27
         44      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.99 ms | 1400 KiB | 17 Q