3v4l.org

run code in 500+ PHP versions simultaneously
<?php /* * Fill in all five below and click blue 'eval();' button below textarea. * * ------------------ */ $server_seed_hash = ''; #SHA-256 Server SEED $server_seed = ''; #Server SEED $client_seed = ''; #Client SEED $nonce = ''; #NONCE /* ------------------ */ if ($server_seed_hash == '' || $server_seed == '' || $client_seed == '' || $nonce == '') exit("Fill in details"); $server_seed_sha256 = hash('sha256', $server_seed); $hash = hash('sha256', $server_seed.'|'.$client_seed.'|'.$nonce); $num = hexdec(substr($hash, 0, 8)) % 10000 + 1; echo "Hash matches: ".($server_seed_hash == $server_seed_sha256 ? 'Yes': 'No')."\n"; echo "Generated number: $num";
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 6, Position 2 = 8
Branch analysis from position: 6
2 jumps found. (Code = 47) Position 1 = 9, Position 2 = 11
Branch analysis from position: 9
2 jumps found. (Code = 47) Position 1 = 12, Position 2 = 14
Branch analysis from position: 12
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 18
Branch analysis from position: 15
1 jumps found. (Code = 61) Position 1 = -2
Branch analysis from position: 18
2 jumps found. (Code = 43) Position 1 = 42, Position 2 = 44
Branch analysis from position: 42
1 jumps found. (Code = 42) Position 1 = 45
Branch analysis from position: 45
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 44
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
Branch analysis from position: 11
Branch analysis from position: 8
filename:       /in/IIBAO
function name:  (null)
number of ops:  52
compiled vars:  !0 = $server_seed_hash, !1 = $server_seed, !2 = $client_seed, !3 = $nonce, !4 = $server_seed_sha256, !5 = $hash, !6 = $num
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    6     0  E >   ASSIGN                                                       !0, ''
    7     1        ASSIGN                                                       !1, ''
    8     2        ASSIGN                                                       !2, ''
    9     3        ASSIGN                                                       !3, ''
   12     4        IS_EQUAL                                             ~11     !0, ''
          5      > JMPNZ_EX                                             ~11     ~11, ->8
          6    >   IS_EQUAL                                             ~12     !1, ''
          7        BOOL                                                 ~11     ~12
          8    > > JMPNZ_EX                                             ~11     ~11, ->11
          9    >   IS_EQUAL                                             ~13     !2, ''
         10        BOOL                                                 ~11     ~13
         11    > > JMPNZ_EX                                             ~11     ~11, ->14
         12    >   IS_EQUAL                                             ~14     !3, ''
         13        BOOL                                                 ~11     ~14
         14    > > JMPZ                                                         ~11, ->18
         15    > > INIT_FCALL                                                   'exit'
         16*       SEND_VAL                                                     'Fill+in+details'
         17*       DO_ICALL                                                     
   14    18    >   INIT_FCALL                                                   'hash'
         19        SEND_VAL                                                     'sha256'
         20        SEND_VAR                                                     !1
         21        DO_ICALL                                             $16     
         22        ASSIGN                                                       !4, $16
   15    23        INIT_FCALL                                                   'hash'
         24        SEND_VAL                                                     'sha256'
         25        CONCAT                                               ~18     !1, '%7C'
         26        CONCAT                                               ~19     ~18, !2
         27        CONCAT                                               ~20     ~19, '%7C'
         28        CONCAT                                               ~21     ~20, !3
         29        SEND_VAL                                                     ~21
         30        DO_ICALL                                             $22     
         31        ASSIGN                                                       !5, $22
   16    32        INIT_FCALL                                                   'hexdec'
         33        FRAMELESS_ICALL_3                substr              ~24     !5, 0
         34        OP_DATA                                                      8
         35        SEND_VAL                                                     ~24
         36        DO_ICALL                                             $25     
         37        MOD                                                  ~26     $25, 10000
         38        ADD                                                  ~27     ~26, 1
         39        ASSIGN                                                       !6, ~27
   18    40        IS_EQUAL                                                     !0, !4
         41      > JMPZ                                                         ~29, ->44
         42    >   QM_ASSIGN                                            ~30     'Yes'
         43      > JMP                                                          ->45
         44    >   QM_ASSIGN                                            ~30     'No'
         45    >   CONCAT                                               ~31     'Hash+matches%3A+', ~30
         46        CONCAT                                               ~32     ~31, '%0A'
         47        ECHO                                                         ~32
   19    48        NOP                                                          
         49        FAST_CONCAT                                          ~33     'Generated+number%3A+', !6
         50        ECHO                                                         ~33
         51      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
166.82 ms | 2003 KiB | 19 Q