hash_error.phpt 472 B

1234567891011121314151617181920
  1. --TEST--
  2. Hash: hash() function : error conditions
  3. --FILE--
  4. <?php
  5. echo "*** Testing hash() : error conditions ***\n";
  6. echo "\n-- Testing hash() function with invalid hash algorithm --\n";
  7. try {
  8. hash('foo', '');
  9. } catch (ValueError $exception) {
  10. echo $exception->getMessage() . "\n";
  11. }
  12. ?>
  13. --EXPECT--
  14. *** Testing hash() : error conditions ***
  15. -- Testing hash() function with invalid hash algorithm --
  16. hash(): Argument #1 ($algo) must be a valid hashing algorithm