Skip to content

Commit 0476f09

Browse files
committed
add test
1 parent 582c8ef commit 0476f09

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

ext/standard/tests/http/gh16810.phpt

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
--TEST--
2+
Bug #79265 variation: "host:" not at start of header
3+
--INI--
4+
allow_url_fopen=1
5+
--SKIPIF--
6+
<?php if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only"); ?>
7+
--FILE--
8+
<?php
9+
$uri = "http://www.example.com";
10+
$config = [
11+
'http' => [
12+
'timeout' => PHP_INT_MIN,
13+
],
14+
];
15+
$ctx = stream_context_create($config);
16+
var_dump(fopen($uri, "r", false, $ctx));
17+
18+
$config['http']['timeout'] = PHP_INT_MAX;
19+
$ctx = stream_context_create($config);
20+
var_dump(fopen($uri, "r", false, $ctx));
21+
?>
22+
--EXPECTF--
23+
resource(%d) of type (stream)
24+
25+
Warning: fopen(http://www.example.com): Failed to open stream: timeout must be lower than %d in %s on line %d
26+
bool(false)

0 commit comments

Comments
 (0)