2 Bug#60106 (stream_socket_server silently truncates long unix socket paths)
5 if( substr(PHP_OS, 0, 3) == "WIN" )
6 die("skip. Do not run on Windows");
10 error_reporting(E_ALL | E_NOTICE);
11 $socket_file = "/tmp/" . str_repeat("a", 512);
12 function get_truncated_socket_filename($errno, $errmsg, $file, $line) {
15 preg_match("#maximum allowed length of (\d+) bytes#", $errmsg, $matches);
16 $socket_file = substr($socket_file, 0, intval($matches[1]) - 1);
18 set_error_handler("get_truncated_socket_filename", E_NOTICE);
19 stream_socket_server("unix://" . $socket_file);
23 stream_socket_server(): socket path exceeded the maximum allowed length of %d bytes and was truncated