1--TEST--
2finfo_file(): Testing file names
3--EXTENSIONS--
4fileinfo
5--FILE--
6<?php
7
8$fp = finfo_open();
9try {
10    var_dump(finfo_file($fp, "\0"));
11} catch (\TypeError $e) {
12    echo $e->getMessage() . \PHP_EOL;
13}
14try {
15    var_dump(finfo_file($fp, ''));
16} catch (\ValueError $e) {
17    echo $e->getMessage() . \PHP_EOL;
18}
19var_dump(finfo_file($fp, '.'));
20var_dump(finfo_file($fp, '&'));
21
22?>
23--EXPECTF--
24finfo_file(): Argument #2 ($filename) must not contain any null bytes
25finfo_file(): Argument #2 ($filename) must not be empty
26string(9) "directory"
27
28Warning: finfo_file(&): Failed to open stream: No such file or directory in %s on line %d
29bool(false)
30