CakeFest 2024: The Official CakePHP Conference

mcrypt_module_self_test

(PHP 4 >= 4.0.2, PHP 5, PHP 7 < 7.2.0, PECL mcrypt >= 1.0.0)

mcrypt_module_self_test在指定模块上执行自检

警告

本函数已自 PHP 7.1.0 起废弃并将自 PHP 7.2.0 起移除。强烈建议不要使用本函数。

说明

mcrypt_module_self_test(string $algorithm, string $lib_dir = ?): bool

在指定模块上执行自检。

参数

algorithm

MCRYPT_ciphername 常量中的一个,或者是字符串值的算法名称。

lib_dir

可选参数 lib_dir, 表示包含加密算法模块的路径。

返回值

自检成功返回 true, 自检失败返回 false

示例

示例 #1 mcrypt_module_self_test() 示例

<?php
var_dump
(mcrypt_module_self_test(MCRYPT_RIJNDAEL_128)) . "\n";
var_dump(mcrypt_module_self_test(MCRYPT_BOGUS_CYPHER));
?>

以上示例会输出:

bool(true)
bool(false)

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top