1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
|
--TEST--
Test posix_fpathconf
--EXTENSIONS--
posix
--SKIPIF--
<?php
if (!function_exists("posix_pathconf")) die("skip only platforms with posix_pathconf");
?>
--FILE--
<?php
var_dump(posix_fpathconf(-1, POSIX_PC_PATH_MAX));
var_dump(posix_errno() != 0);
try {
posix_fpathconf("string arg", POSIX_PC_PATH_MAX);
} catch (\TypeError $e) {
echo $e->getMessage() . "\n";
}
$fd = fopen(__DIR__, "r");
var_dump(posix_fpathconf($fd, POSIX_PC_PATH_MAX));
fclose($fd);
?>
--EXPECTF--
bool(false)
bool(true)
posix_fpathconf(): Argument #1 ($file_descriptor) must be of type int|resource, string given
int(%d)
|