3v4l.org

run code in 300+ PHP versions simultaneously
<?php $hash = 'FdsfDFwfdfs23C4DSF32Fs0ozkbHI8mDIUxjEqT/oJCm32Ly2Rjs5vzUSg9do0X1tE7CC0pQZg9MiSHrZVdXlMuy6VclOhPdLU5pHRKaTu/'; $salt = '25c5850100451f12'; $algo = '$6'; $password = 'test'; $cost = '$rounds=25000$'; function check_password($hash, $salt, $password){ $hash = ($algo.$cost.$salt.'$'.$hash); if($hash == crypt($password, substr($hash, 0, 33))){ //Regenerate new hash and salt for given password echo 'yes'; return true; }else{ echo 'no'; return false; } } check_password($hash, $salt, $password); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lc0a5
function name:  (null)
number of ops:  11
compiled vars:  !0 = $hash, !1 = $salt, !2 = $algo, !3 = $password, !4 = $cost
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'FdsfDFwfdfs23C4DSF32Fs0ozkbHI8mDIUxjEqT%2FoJCm32Ly2Rjs5vzUSg9do0X1tE7CC0pQZg9MiSHrZVdXlMuy6VclOhPdLU5pHRKaTu%2F'
    3     1        ASSIGN                                                   !1, '25c5850100451f12'
    4     2        ASSIGN                                                   !2, '%246'
    5     3        ASSIGN                                                   !3, 'test'
    6     4        ASSIGN                                                   !4, '%24rounds%3D25000%24'
   20     5        INIT_FCALL                                               'check_password'
          6        SEND_VAR                                                 !0
          7        SEND_VAR                                                 !1
          8        SEND_VAR                                                 !3
          9        DO_FCALL                                      0          
   22    10      > RETURN                                                   1

Function check_password:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 22
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lc0a5
function name:  check_password
number of ops:  25
compiled vars:  !0 = $hash, !1 = $salt, !2 = $password, !3 = $algo, !4 = $cost
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
    9     3        CONCAT                                           ~5      !3, !4
          4        CONCAT                                           ~6      ~5, !1
          5        CONCAT                                           ~7      ~6, '%24'
          6        CONCAT                                           ~8      ~7, !0
          7        ASSIGN                                                   !0, ~8
   10     8        INIT_FCALL                                               'crypt'
          9        SEND_VAR                                                 !2
         10        INIT_FCALL                                               'substr'
         11        SEND_VAR                                                 !0
         12        SEND_VAL                                                 0
         13        SEND_VAL                                                 33
         14        DO_ICALL                                         $10     
         15        SEND_VAR                                                 $10
         16        DO_ICALL                                         $11     
         17        IS_EQUAL                                                 !0, $11
         18      > JMPZ                                                     ~12, ->22
   12    19    >   ECHO                                                     'yes'
   13    20      > RETURN                                                   <true>
         21*       JMP                                                      ->24
   15    22    >   ECHO                                                     'no'
   16    23      > RETURN                                                   <false>
   18    24*     > RETURN                                                   null

End of function check_password

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
199.41 ms | 1403 KiB | 18 Q