1--TEST--
2dl() filename length checks (CVE-2007-4887)
3--SKIPIF--
4<?php
5$enabled_sapi = array('cgi-fcgi', 'cli', 'embed', 'fpm');
6if (!in_array(php_sapi_name(), $enabled_sapi)) {
7    die('skip dl() is not enabled for ' . php_sapi_name());
8}
9if (getenv('SKIP_ASAN')) die('xleak dl() crashes LSan');
10?>
11--INI--
12enable_dl=1
13--FILE--
14<?php
15
16var_dump(dl(str_repeat("a", 8376757)));
17
18?>
19--EXPECTF--
20Warning: dl(): Filename exceeds the maximum allowed length of %d characters in %s on line %d
21bool(false)
22