3v4l.org

run code in 300+ 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 = 16
Branch analysis from position: 15
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 16
2 jumps found. (Code = 43) Position 1 = 43, Position 2 = 45
Branch analysis from position: 43
1 jumps found. (Code = 42) Position 1 = 46
Branch analysis from position: 46
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 45
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/ZbpeD
function name:  (null)
number of ops:  53
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, ->16
         15    > > EXIT                                                     'Fill+in+details'
   14    16    >   INIT_FCALL                                               'hash'
         17        SEND_VAL                                                 'sha256'
         18        SEND_VAR                                                 !1
         19        DO_ICALL                                         $15     
         20        ASSIGN                                                   !4, $15
   15    21        INIT_FCALL                                               'hash'
         22        SEND_VAL                                                 'sha256'
         23        CONCAT                                           ~17     !1, '%7C'
         24        CONCAT                                           ~18     ~17, !2
         25        CONCAT                                           ~19     ~18, '%7C'
         26        CONCAT                                           ~20     ~19, !3
         27        SEND_VAL                                                 ~20
         28        DO_ICALL                                         $21     
         29        ASSIGN                                                   !5, $21
   16    30        INIT_FCALL                                               'hexdec'
         31        INIT_FCALL                                               'substr'
         32        SEND_VAR                                                 !5
         33        SEND_VAL                                                 0
         34        SEND_VAL                                                 8
         35        DO_ICALL                                         $23     
         36        SEND_VAR                                                 $23
         37        DO_ICALL                                         $24     
         38        MOD                                              ~25     $24, 10000
         39        ADD                                              ~26     ~25, 1
         40        ASSIGN                                                   !6, ~26
   18    41        IS_EQUAL                                                 !0, !4
         42      > JMPZ                                                     ~28, ->45
         43    >   QM_ASSIGN                                        ~29     'Yes'
         44      > JMP                                                      ->46
         45    >   QM_ASSIGN                                        ~29     'No'
         46    >   CONCAT                                           ~30     'Hash+matches%3A+', ~29
         47        CONCAT                                           ~31     ~30, '%0A'
         48        ECHO                                                     ~31
   19    49        NOP                                                      
         50        FAST_CONCAT                                      ~32     'Generated+number%3A+', !6
         51        ECHO                                                     ~32
         52      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.2 ms | 941 KiB | 20 Q