array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'fr', ), 'this' => array ( 0 => 'function.mcrypt-module-self-test.php', 1 => 'mcrypt_module_self_test', ), 'up' => array ( 0 => 'ref.mcrypt.php', 1 => 'Fonctions Mcrypt', ), 'prev' => array ( 0 => 'function.mcrypt-module-open.php', 1 => 'mcrypt_module_open', ), 'next' => array ( 0 => 'function.mdecrypt-generic.php', 1 => 'mdecrypt_generic', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'fr', 'path' => 'reference/mcrypt/functions/mcrypt-module-self-test.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PHP 4 >= 4.0.2, PHP 5, PHP 7 < 7.2.0, PECL mcrypt >= 1.0.0)
mcrypt_module_self_test — Teste un mode
Cette fonction est OBSOLÈTE à partir de PHP 7.1.0 et a été SUPPRIMÉE à partir de PHP 7.2.0. Dépendre de cette fonction est fortement déconseillé.
Effectue un test sur l'algorithme spécifié.
algorithm
Une constante parmi les constantes
MCRYPT_ciphername
, ou le nom de l'algorithme, sous la forme d'une chaîne de caractères.
lib_dir
Le paramètre optionnel lib_dir
contient
le chemin jusqu'au module de l'algorithme sur le système.
Exemple #1 Exemple avec mcrypt_module_self_test()
<?php
var_dump(mcrypt_module_self_test(MCRYPT_RIJNDAEL_128)) . "\n";
var_dump(mcrypt_module_self_test(MCRYPT_BOGUS_CYPHER));
?>
L'exemple ci-dessus va afficher :
bool(true) bool(false)