1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 16:22:37 +01:00
Files
archived-php-src/ext/hash/tests/hash_error.phpt
2020-06-24 13:13:44 +02:00

21 lines
472 B
PHP

--TEST--
Hash: hash() function : error conditions
--FILE--
<?php
echo "*** Testing hash() : error conditions ***\n";
echo "\n-- Testing hash() function with invalid hash algorithm --\n";
try {
hash('foo', '');
} catch (ValueError $exception) {
echo $exception->getMessage() . "\n";
}
?>
--EXPECT--
*** Testing hash() : error conditions ***
-- Testing hash() function with invalid hash algorithm --
hash(): Argument #1 ($algo) must be a valid hashing algorithm