1--TEST--
2Test error operation of random_bytes()
3--FILE--
4<?php
5//-=-=-=-
6
7try {
8    $bytes = random_bytes();
9} catch (TypeError $e) {
10    echo $e->getMessage().PHP_EOL;
11}
12
13try {
14    $bytes = random_bytes(0);
15} catch (Error $e) {
16    echo $e->getMessage().PHP_EOL;
17}
18
19?>
20--EXPECT--
21random_bytes() expects exactly 1 argument, 0 given
22random_bytes(): Argument #1 ($length) must be greater than 0
23