1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 08:12:21 +01:00
Files
archived-php-src/ext/random/tests/01_functions/random_bytes_error.phpt

23 lines
393 B
PHP

--TEST--
Test error operation of random_bytes()
--FILE--
<?php
//-=-=-=-
try {
$bytes = random_bytes();
} catch (TypeError $e) {
echo $e->getMessage().PHP_EOL;
}
try {
$bytes = random_bytes(0);
} catch (Error $e) {
echo $e->getMessage().PHP_EOL;
}
?>
--EXPECT--
random_bytes() expects exactly 1 argument, 0 given
random_bytes(): Argument #1 ($length) must be greater than 0