xref: /PHP-8.0/ext/standard/tests/time/bug60222.phpt (revision bb6f3740)
1--TEST--
2Bug #60222 (time_nanosleep() does validate input params)
3--FILE--
4<?php
5    try {
6        time_nanosleep(-1, 0);
7    } catch (ValueError $exception) {
8        echo $exception->getMessage() . "\n";
9    }
10
11    try {
12        time_nanosleep(0, -1);
13    } catch (ValueError $exception) {
14        echo $exception->getMessage() . "\n";
15    }
16?>
17--EXPECT--
18time_nanosleep(): Argument #1 ($seconds) must be greater than or equal to 0
19time_nanosleep(): Argument #2 ($nanoseconds) must be greater than or equal to 0
20