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; 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 = 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/1cSGt
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, ->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        ASSIGN                                                   !6, ~25
   18    40        IS_EQUAL                                                 !0, !4
         41      > JMPZ                                                     ~27, ->44
         42    >   QM_ASSIGN                                        ~28     'Yes'
         43      > JMP                                                      ->45
         44    >   QM_ASSIGN                                        ~28     'No'
         45    >   CONCAT                                           ~29     'Hash+matches%3A+', ~28
         46        CONCAT                                           ~30     ~29, '%0A'
         47        ECHO                                                     ~30
   19    48        NOP                                                      
         49        FAST_CONCAT                                      ~31     'Generated+number%3A+', !6
         50        ECHO                                                     ~31
         51      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
142.69 ms | 1452 KiB | 16 Q