【发布时间】:2017-08-07 15:45:52
【问题描述】:
错误密码散列线 1 类密码散列
不推荐使用 PHP:与其类同名的方法在 PHP 的未来版本中将不再是构造函数; PasswordHash 有一个不推荐使用的构造函数 如何修复错误? 我的数据库 7.1
class PasswordHash {
var $itoa64;
var $iteration_count_log2;
var $portable_hashes;
var $random_state;
var $hash_method; // do not modify directly, use set_hash_method instead.
function PasswordHash($iteration_count_log2 = 9, $portable_hashes = false, $hash_method = null, $full_compat = true)
{
$this->portable_hashes = $portable_hashes;
$this->full_compat = $full_compat;
if ($this->set_hash_method($hash_method)===false){
return false;
}
$this->itoa64 = './0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
if ($iteration_count_log2 < 4 || $iteration_count_log2 > 31)
$iteration_count_log2 = 8;
$this->iteration_count_log2 = $iteration_count_log2;
$this->random_state = microtime();
if (function_exists('getmypid'))
$this->random_state .= getmypid();
return $this;
}
【问题讨论】:
-
在 php 类构造函数中与类名不同,只需将
function PasswordHash替换为public function __construct -
伙计们,让我们投票结束这个问题。它太简单了,垃圾和太宽泛
-
PHP 确实有一个相当全面的在线手册,你知道的。我建议您阅读它以了解此类内容。
标签: php