1--TEST--
2finfo_open(): Testing magic_file names
3--EXTENSIONS--
4fileinfo
5--INI--
6open_basedir='.'
7--FILE--
8<?php
9$buggyPath = str_repeat('a', PHP_MAXPATHLEN + 1);
10
11var_dump(finfo_open(FILEINFO_MIME, $buggyPath));
12
13try {
14    $object = new finfo(FILEINFO_MIME, $buggyPath);
15} catch (\Exception $ex) {
16    echo "TEST:" . $ex->getMessage() . PHP_EOL;
17}
18?>
19--EXPECTF--
20Warning: finfo_open(): File name is longer than the maximum allowed path length on this platform (%d): %s in %s on line %d
21bool(false)
22TEST:finfo::__construct(): File name is longer than the maximum allowed path length on this platform (%d): %s
23