3v4l.org

run code in 300+ PHP versions simultaneously
<?php $game_id = 2820; $client_seed = "gJyxdPdhqv"; $server_seed = "5a5e6a3494cf9572b6dc5dd6aee4263b6eec8b8f331e29c426d03f9ab6ade17f"; $idClientSeed = $client_seed . "-" . $game_id; $hex = hash_hmac("sha512", $idClientSeed, $server_seed); $index = 0; $lucky = hexdec(substr($hex, $index * 5, (($index * 5) - $index * 5 + 5))); while ($lucky >= 1e6) { $index += 1; $lucky = hexdec(substr($hex, $index * 5, (($index * 5) - $index * 5 + 5))); if ($index * 5 + 5 > 129) { $lucky = 9999; break; } } $number = ($lucky % 1e4) * 1e-2; echo "Roll: " . $number;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 49
Branch analysis from position: 49
2 jumps found. (Code = 44) Position 1 = 51, Position 2 = 28
Branch analysis from position: 51
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 28
2 jumps found. (Code = 43) Position 1 = 47, Position 2 = 49
Branch analysis from position: 47
1 jumps found. (Code = 42) Position 1 = 51
Branch analysis from position: 51
Branch analysis from position: 49
filename:       /in/koPba
function name:  (null)
number of ops:  57
compiled vars:  !0 = $game_id, !1 = $client_seed, !2 = $server_seed, !3 = $idClientSeed, !4 = $hex, !5 = $index, !6 = $lucky, !7 = $number
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 2820
    4     1        ASSIGN                                                   !1, 'gJyxdPdhqv'
    5     2        ASSIGN                                                   !2, '5a5e6a3494cf9572b6dc5dd6aee4263b6eec8b8f331e29c426d03f9ab6ade17f'
    7     3        CONCAT                                           ~11     !1, '-'
          4        CONCAT                                           ~12     ~11, !0
          5        ASSIGN                                                   !3, ~12
    8     6        INIT_FCALL                                               'hash_hmac'
          7        SEND_VAL                                                 'sha512'
          8        SEND_VAR                                                 !3
          9        SEND_VAR                                                 !2
         10        DO_ICALL                                         $14     
         11        ASSIGN                                                   !4, $14
    9    12        ASSIGN                                                   !5, 0
   10    13        INIT_FCALL                                               'hexdec'
         14        INIT_FCALL                                               'substr'
         15        SEND_VAR                                                 !4
         16        MUL                                              ~17     !5, 5
         17        SEND_VAL                                                 ~17
         18        MUL                                              ~18     !5, 5
         19        MUL                                              ~19     !5, 5
         20        SUB                                              ~20     ~18, ~19
         21        ADD                                              ~21     ~20, 5
         22        SEND_VAL                                                 ~21
         23        DO_ICALL                                         $22     
         24        SEND_VAR                                                 $22
         25        DO_ICALL                                         $23     
         26        ASSIGN                                                   !6, $23
   12    27      > JMP                                                      ->49
   13    28    >   ASSIGN_OP                                     1          !5, 1
   14    29        INIT_FCALL                                               'hexdec'
         30        INIT_FCALL                                               'substr'
         31        SEND_VAR                                                 !4
         32        MUL                                              ~26     !5, 5
         33        SEND_VAL                                                 ~26
         34        MUL                                              ~27     !5, 5
         35        MUL                                              ~28     !5, 5
         36        SUB                                              ~29     ~27, ~28
         37        ADD                                              ~30     ~29, 5
         38        SEND_VAL                                                 ~30
         39        DO_ICALL                                         $31     
         40        SEND_VAR                                                 $31
         41        DO_ICALL                                         $32     
         42        ASSIGN                                                   !6, $32
   15    43        MUL                                              ~34     !5, 5
         44        ADD                                              ~35     ~34, 5
         45        IS_SMALLER                                               129, ~35
         46      > JMPZ                                                     ~36, ->49
   16    47    >   ASSIGN                                                   !6, 9999
   17    48      > JMP                                                      ->51
   12    49    >   IS_SMALLER_OR_EQUAL                                      1.0e+6, !6
         50      > JMPNZ                                                    ~38, ->28
   21    51    >   MOD                                              ~39     !6, 10000
         52        MUL                                              ~40     ~39, 0.01
         53        ASSIGN                                                   !7, ~40
   22    54        CONCAT                                           ~42     'Roll%3A+', !7
         55        ECHO                                                     ~42
   23    56      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.34 ms | 1400 KiB | 19 Q