3v4l.org

run code in 300+ PHP versions simultaneously
<?php $password = 'foobar'; $salt = 'qwertzuiopasdfghjklyxc'; $hash = password_hash($password, PASSWORD_BCRYPT, [ 'salt' => $salt, ]); $froxlor_pwd_salt = str_replace(substr(strrchr($hash, "$"), 1), "", $hash); $froxlor_pwd_check = crypt($password, $froxlor_pwd_salt); $my_pwd_check = crypt($password, $froxlor_pwd_salt . $salt); printf("Password hashed (db): %s\n used salt: %s\n ---\n Froxlor password salt: %s\n Froxlor password check: %s\n ---\n My password check: %s", $hash, $salt, $froxlor_pwd_salt, $froxlor_pwd_check, $my_pwd_check);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HKuRj
function name:  (null)
number of ops:  43
compiled vars:  !0 = $password, !1 = $salt, !2 = $hash, !3 = $froxlor_pwd_salt, !4 = $froxlor_pwd_check, !5 = $my_pwd_check
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'foobar'
    4     1        ASSIGN                                                   !1, 'qwertzuiopasdfghjklyxc'
    6     2        INIT_FCALL                                               'password_hash'
          3        SEND_VAR                                                 !0
          4        SEND_VAL                                                 '2y'
    7     5        INIT_ARRAY                                       ~8      !1, 'salt'
          6        SEND_VAL                                                 ~8
          7        DO_ICALL                                         $9      
    6     8        ASSIGN                                                   !2, $9
   10     9        INIT_FCALL                                               'str_replace'
         10        INIT_FCALL                                               'substr'
         11        INIT_FCALL                                               'strrchr'
         12        SEND_VAR                                                 !2
         13        SEND_VAL                                                 '%24'
         14        DO_ICALL                                         $11     
         15        SEND_VAR                                                 $11
         16        SEND_VAL                                                 1
         17        DO_ICALL                                         $12     
         18        SEND_VAR                                                 $12
         19        SEND_VAL                                                 ''
         20        SEND_VAR                                                 !2
         21        DO_ICALL                                         $13     
         22        ASSIGN                                                   !3, $13
   11    23        INIT_FCALL                                               'crypt'
         24        SEND_VAR                                                 !0
         25        SEND_VAR                                                 !3
         26        DO_ICALL                                         $15     
         27        ASSIGN                                                   !4, $15
   13    28        INIT_FCALL                                               'crypt'
         29        SEND_VAR                                                 !0
         30        CONCAT                                           ~17     !3, !1
         31        SEND_VAL                                                 ~17
         32        DO_ICALL                                         $18     
         33        ASSIGN                                                   !5, $18
   16    34        INIT_FCALL                                               'printf'
         35        SEND_VAL                                                 'Password+hashed+%28db%29%3A+%25s%0A%0Aused+salt%3A+%25s%0A%0A---%0A%0AFroxlor+password+salt%3A+%25s%0A%0AFroxlor+password+check%3A+%25s%0A%0A---%0A%0AMy+password+check%3A+%25s'
   23    36        SEND_VAR                                                 !2
         37        SEND_VAR                                                 !1
   24    38        SEND_VAR                                                 !3
         39        SEND_VAR                                                 !4
   25    40        SEND_VAR                                                 !5
         41        DO_ICALL                                                 
         42      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.12 ms | 1400 KiB | 25 Q