3v4l.org

run code in 300+ PHP versions simultaneously
<?php $password = bin2hex(random_bytes(128)); $hashed = hash('sha256', $password, true); // Raw binary $salt = random_bytes(32); // Pwhash: $pwhash = hash_pbkdf2('sha256', $password, $salt, 1000, 64); // Now the attack $attack = hash_pbkdf2('sha256', $hashed, $salt, 1000, 64); var_dump([ 'password-hash' => $pwhash, 'attack-output' => $attack ]);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/nqoRI
function name:  (null)
number of ops:  39
compiled vars:  !0 = $password, !1 = $hashed, !2 = $salt, !3 = $pwhash, !4 = $attack
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'bin2hex'
          1        INIT_FCALL                                               'random_bytes'
          2        SEND_VAL                                                 128
          3        DO_ICALL                                         $5      
          4        SEND_VAR                                                 $5
          5        DO_ICALL                                         $6      
          6        ASSIGN                                                   !0, $6
    4     7        INIT_FCALL                                               'hash'
          8        SEND_VAL                                                 'sha256'
          9        SEND_VAR                                                 !0
         10        SEND_VAL                                                 <true>
         11        DO_ICALL                                         $8      
         12        ASSIGN                                                   !1, $8
    5    13        INIT_FCALL                                               'random_bytes'
         14        SEND_VAL                                                 32
         15        DO_ICALL                                         $10     
         16        ASSIGN                                                   !2, $10
    8    17        INIT_FCALL                                               'hash_pbkdf2'
         18        SEND_VAL                                                 'sha256'
         19        SEND_VAR                                                 !0
         20        SEND_VAR                                                 !2
         21        SEND_VAL                                                 1000
         22        SEND_VAL                                                 64
         23        DO_ICALL                                         $12     
         24        ASSIGN                                                   !3, $12
   11    25        INIT_FCALL                                               'hash_pbkdf2'
         26        SEND_VAL                                                 'sha256'
         27        SEND_VAR                                                 !1
         28        SEND_VAR                                                 !2
         29        SEND_VAL                                                 1000
         30        SEND_VAL                                                 64
         31        DO_ICALL                                         $14     
         32        ASSIGN                                                   !4, $14
   13    33        INIT_FCALL                                               'var_dump'
   14    34        INIT_ARRAY                                       ~16     !3, 'password-hash'
   15    35        ADD_ARRAY_ELEMENT                                ~16     !4, 'attack-output'
         36        SEND_VAL                                                 ~16
   13    37        DO_ICALL                                                 
   16    38      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
128.56 ms | 1458 KiB | 18 Q