1--TEST--
2posix_isatty(): errors for invalid file descriptors
3--EXTENSIONS--
4posix
5--SKIPIF--
6<?php
7if (PHP_INT_SIZE != 8) die('skip C int is same size as zend_long');
8?>
9--FILE--
10<?php
11
12$values = [
13    -1,
14    10024,
15    2**50+1,
16];
17
18foreach ($values as $value) {
19    var_dump(posix_isatty($value));
20    var_dump(posix_strerror(posix_get_last_error()));
21}
22?>
23--EXPECT--
24bool(false)
25string(19) "Bad file descriptor"
26bool(false)
27string(19) "Bad file descriptor"
28bool(false)
29string(19) "Bad file descriptor"
30