1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00
Files
archived-php-src/ext/posix/tests/posix_isatty_value_errors.phpt
Petr Sumbera ce1cadba29 Fix Solaris tests and add nightly CI job
Closes GH-20709
2026-03-04 10:12:03 +01:00

34 lines
743 B
PHP

--TEST--
posix_isatty(): errors for invalid file descriptors
--EXTENSIONS--
posix
--SKIPIF--
<?php
if (PHP_INT_SIZE != 8) die('skip C int is same size as zend_long');
?>
--FILE--
<?php
$values = [
-1,
10024,
2**50+1,
];
foreach ($values as $value) {
var_dump(posix_isatty($value));
var_dump(posix_strerror(posix_get_last_error()));
}
?>
--EXPECTF--
Warning: posix_isatty(): Argument #1 ($file_descriptor) must be between 0 and %d in %s on line %d
bool(false)
string(%d) "Bad file %r(descriptor|number)%r"
bool(false)
string(%d) "Bad file %r(descriptor|number)%r"
Warning: posix_isatty(): Argument #1 ($file_descriptor) must be between 0 and %d in %s on line %d
bool(false)
string(%d) "Bad file %r(descriptor|number)%r"