mirror of
https://github.com/php/php-src.git
synced 2026-04-19 22:11:12 +02:00
Closes GH-5066 As a first step, let's capitalize their initial letter when it is applicable.
36 lines
734 B
PHP
36 lines
734 B
PHP
--TEST--
|
|
Bug #76342 (file_get_contents waits twice specified timeout)
|
|
--INI--
|
|
allow_url_fopen=1
|
|
--SKIPIF--
|
|
<?php require 'server.inc'; http_server_skipif('tcp://127.0.0.1:12342'); ?>
|
|
--FILE--
|
|
<?php
|
|
require 'server.inc';
|
|
|
|
$timeout = 0.5;
|
|
$options = [
|
|
'http' => [
|
|
'timeout' => $timeout,
|
|
],
|
|
];
|
|
|
|
$ctx = stream_context_create($options);
|
|
|
|
$pid = http_server_sleep('tcp://127.0.0.1:12342');
|
|
|
|
$start = microtime(true);
|
|
file_get_contents('http://127.0.0.1:12342/', false, $ctx);
|
|
$diff = microtime(true) - $start;
|
|
if ($diff >= 2 * $timeout) {
|
|
echo "FAIL: $diff\n";
|
|
}
|
|
|
|
http_server_kill($pid);
|
|
|
|
?>
|
|
DONE
|
|
--EXPECTF--
|
|
Warning: file_get_contents(http://127.0.0.1:12342/): Failed to open stream: HTTP request failed! in %s on line %d
|
|
DONE
|