3v4l.org

run code in 500+ PHP versions simultaneously
<?php /* * Fill in all three below and click the blue 'eval();' button. * ------------------ */ $server_seed = ""; $client_seed = ""; $game_id = ""; /* ------------------ */ if ($server_seed == '' || $client_seed === "" || $game_id == '') { echo "Fill in details"; return; } // Create HMAC-SHA256 hash $message = $client_seed . "-" . $game_id; $hmac_hash = hash_hmac('sha256', $message, $server_seed); // Convert hex to decimal using bcmath for large numbers $decimal_value = '0'; $length = strlen($hmac_hash); for ($i = 0; $i < $length; $i++) { $decimal_value = bcmul($decimal_value, '16'); $decimal_value = bcadd($decimal_value, hexdec($hmac_hash[$i])); } // Apply modulo 10^8 $roll = (int) bcmod($decimal_value, '100000000'); // Same "inverse odds" transform as crash_point_from_roll() server-side — // house edge 0.07, floored to the nearest cent, floor of 1.00x. $house_edge = 0.07; $r = $roll / 100000000; $raw = (1 - $house_edge) / (1 - $r); $crash_point = max(1.0, floor($raw * 100) / 100); echo "Roll: " . $roll . "\n"; echo "Crash point: " . number_format($crash_point, 2) . "x"; ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 5, Position 2 = 7
Branch analysis from position: 5
2 jumps found. (Code = 47) Position 1 = 8, Position 2 = 10
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 13
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 42
Branch analysis from position: 42
2 jumps found. (Code = 44) Position 1 = 44, Position 2 = 27
Branch analysis from position: 44
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 27
2 jumps found. (Code = 44) Position 1 = 44, Position 2 = 27
Branch analysis from position: 44
Branch analysis from position: 27
Branch analysis from position: 10
Branch analysis from position: 7
filename:       /in/m4OTa
function name:  (null)
number of ops:  75
compiled vars:  !0 = $server_seed, !1 = $client_seed, !2 = $game_id, !3 = $message, !4 = $hmac_hash, !5 = $decimal_value, !6 = $length, !7 = $i, !8 = $roll, !9 = $house_edge, !10 = $r, !11 = $raw, !12 = $crash_point
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    5     0  E >   ASSIGN                                                       !0, ''
    6     1        ASSIGN                                                       !1, ''
    7     2        ASSIGN                                                       !2, ''
   10     3        IS_EQUAL                                             ~16     !0, ''
          4      > JMPNZ_EX                                             ~16     ~16, ->7
          5    >   IS_IDENTICAL                                         ~17     !1, ''
          6        BOOL                                                 ~16     ~17
          7    > > JMPNZ_EX                                             ~16     ~16, ->10
          8    >   IS_EQUAL                                             ~18     !2, ''
          9        BOOL                                                 ~16     ~18
         10    > > JMPZ                                                         ~16, ->13
   11    11    >   ECHO                                                         'Fill+in+details'
   12    12      > RETURN                                                       null
   16    13    >   CONCAT                                               ~19     !1, '-'
         14        CONCAT                                               ~20     ~19, !2
         15        ASSIGN                                                       !3, ~20
   17    16        INIT_FCALL                                                   'hash_hmac'
         17        SEND_VAL                                                     'sha256'
         18        SEND_VAR                                                     !3
         19        SEND_VAR                                                     !0
         20        DO_ICALL                                             $22     
         21        ASSIGN                                                       !4, $22
   20    22        ASSIGN                                                       !5, '0'
   21    23        STRLEN                                               ~25     !4
         24        ASSIGN                                                       !6, ~25
   23    25        ASSIGN                                                       !7, 0
         26      > JMP                                                          ->42
   24    27    >   INIT_FCALL_BY_NAME                                           'bcmul'
         28        SEND_VAR_EX                                                  !5
         29        SEND_VAL_EX                                                  '16'
         30        DO_FCALL                                          0  $28     
         31        ASSIGN                                                       !5, $28
   25    32        INIT_FCALL_BY_NAME                                           'bcadd'
         33        SEND_VAR_EX                                                  !5
         34        INIT_FCALL                                                   'hexdec'
         35        FETCH_DIM_R                                          ~30     !4, !7
         36        SEND_VAL                                                     ~30
         37        DO_ICALL                                             $31     
         38        SEND_VAR_NO_REF_EX                                           $31
         39        DO_FCALL                                          0  $32     
         40        ASSIGN                                                       !5, $32
   23    41        PRE_INC                                                      !7
         42    >   IS_SMALLER                                                   !7, !6
         43      > JMPNZ                                                        ~35, ->27
   29    44    >   INIT_FCALL_BY_NAME                                           'bcmod'
         45        SEND_VAR_EX                                                  !5
         46        SEND_VAL_EX                                                  '100000000'
         47        DO_FCALL                                          0  $36     
         48        CAST                                              4  ~37     $36
         49        ASSIGN                                                       !8, ~37
   33    50        ASSIGN                                                       !9, 0.07
   34    51        DIV                                                  ~40     !8, 100000000
         52        ASSIGN                                                       !10, ~40
   35    53        SUB                                                  ~42     1, !9
         54        SUB                                                  ~43     1, !10
         55        DIV                                                  ~44     ~42, ~43
         56        ASSIGN                                                       !11, ~44
   36    57        INIT_FCALL                                                   'floor'
         58        MUL                                                  ~46     !11, 100
         59        SEND_VAL                                                     ~46
         60        DO_ICALL                                             $47     
         61        DIV                                                  ~48     $47, 100
         62        FRAMELESS_ICALL_2                max                 ~49     1, ~48
         63        ASSIGN                                                       !12, ~49
   38    64        CONCAT                                               ~51     'Roll%3A+', !8
         65        CONCAT                                               ~52     ~51, '%0A'
         66        ECHO                                                         ~52
   39    67        INIT_FCALL                                                   'number_format'
         68        SEND_VAR                                                     !12
         69        SEND_VAL                                                     2
         70        DO_ICALL                                             $53     
         71        CONCAT                                               ~54     'Crash+point%3A+', $53
         72        CONCAT                                               ~55     ~54, 'x'
         73        ECHO                                                         ~55
   40    74      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
150.36 ms | 778 KiB | 12 Q