3v4l.org

run code in 500+ PHP versions simultaneously
<?php function VerifyPasswordHash($password,$pass_hash,$pass_salt){ $sig = hash_hmac('sha512', $password, hex2bin(substr($pass_salt, 2)), false); $hash = '0x' . strtoupper($sig); return $hash === $pass_hash; } $matches = VerifyPasswordHash( "Password202!", "0x0C3F6C5921CCD0305B2EDEDE1553B1DF55B87A9D55FEE3384A3833611BC40D106BBB48CCE1093AE35B9D0E3A1FE62E86186A6EC143BA00E53945E99C259B4913", "0xC62C5A645280DBCC615ED4A3E861D800B00A929856A9664B3AED50A06481ED19AFB09F74D3D7A9EA25327D93F23FDFBD2DE8CF3A75D65A3EA97290E0486F1F4322D2B5853AE6FE848E50355C35B62A993CF6689D9F9ABC861C5E7D88B099617E6A6C7792E285EFBB809FD69CD926C9BD9129AD1BE7DDB5DD459C2B9A2B945B31" ); var_dump($matches);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GhZtG
function name:  (null)
number of ops:  10
compiled vars:  !0 = $matches
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   10     0  E >   INIT_FCALL                                                   'verifypasswordhash'
   11     1        SEND_VAL                                                     'Password202%21'
   12     2        SEND_VAL                                                     '0x0C3F6C5921CCD0305B2EDEDE1553B1DF55B87A9D55FEE3384A3833611BC40D106BBB48CCE1093AE35B9D0E3A1FE62E86186A6EC143BA00E53945E99C259B4913'
   13     3        SEND_VAL                                                     '0xC62C5A645280DBCC615ED4A3E861D800B00A929856A9664B3AED50A06481ED19AFB09F74D3D7A9EA25327D93F23FDFBD2DE8CF3A75D65A3EA97290E0486F1F4322D2B5853AE6FE848E50355C35B62A993CF6689D9F9ABC861C5E7D88B099617E6A6C7792E285EFBB809FD69CD926C9BD9129AD1BE7DDB5DD459C2B9A2B945B31'
   10     4        DO_FCALL                                          0  $1      
          5        ASSIGN                                                       !0, $1
   16     6        INIT_FCALL                                                   'var_dump'
          7        SEND_VAR                                                     !0
          8        DO_ICALL                                                     
          9      > RETURN                                                       1

Function verifypasswordhash:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GhZtG
function name:  VerifyPasswordHash
number of ops:  22
compiled vars:  !0 = $password, !1 = $pass_hash, !2 = $pass_salt, !3 = $sig, !4 = $hash
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
          2        RECV                                                 !2      
    4     3        INIT_FCALL                                                   'hash_hmac'
          4        SEND_VAL                                                     'sha512'
          5        SEND_VAR                                                     !0
          6        INIT_FCALL                                                   'hex2bin'
          7        FRAMELESS_ICALL_2                substr              ~5      !2, 2
          8        SEND_VAL                                                     ~5
          9        DO_ICALL                                             $6      
         10        SEND_VAR                                                     $6
         11        SEND_VAL                                                     <false>
         12        DO_ICALL                                             $7      
         13        ASSIGN                                                       !3, $7
    5    14        INIT_FCALL                                                   'strtoupper'
         15        SEND_VAR                                                     !3
         16        DO_ICALL                                             $9      
         17        CONCAT                                               ~10     '0x', $9
         18        ASSIGN                                                       !4, ~10
    7    19        IS_IDENTICAL                                         ~12     !4, !1
         20      > RETURN                                                       ~12
    8    21*     > RETURN                                                       null

End of function verifypasswordhash

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
457.86 ms | 1883 KiB | 18 Q