--SKIPIF--
<?php
include 'skip.inc';
-checkver(5);
+checkmin(5);
?>
--FILE--
<?php
--- /dev/null
+--TEST--
+HttpMessage properties
+--SKIPIF--
+<?php
+include 'skip.inc';
+checkmin(5);
+checkcls('HttpMessage');
+?>
+--FILE--
+<?php
+class Message extends HttpMessage
+{
+ public function test()
+ {
+ print_r($this->headers);
+ $this->headers['Foo'] = 'Bar';
+ }
+}
+
+error_reporting(E_ALL|E_STRICT);
+
+echo "-TEST\n";
+$m = new Message;
+$m->test();
+echo "Done\n";
+?>
+--EXPECTF--
+%sTEST
+Array
+(
+)
+%sFatal error%sCannot access HttpMessage properties by reference or array key/index in%s
--SKIPIF--
<?php
include 'skip.inc';
-checkver(5);
+checkmin(5);
checkcls('HttpRequestPool');
checkurl('www.php.net');
checkurl('de.php.net');
--SKIPIF--
<?php
include 'skip.inc';
-checkver(5);
+checkmin(5);
checkcls('HttpRequest');
?>
--FILE--
--SKIPIF--
<?php
include 'skip.inc';
-checkver(5);
+checkmin(5);
checkcls('HttpRequest');
checkurl('www.google.com');
checkurl('dev.iworks.at');
--SKIPIF--
<?php
include 'skip.inc';
-checkver(5);
+checkmin(5);
checkcls('HttpRequest');
checkurl('arweb.info');
?>
--SKIPIF--
<?php
include 'skip.inc';
-checkver(5);
+checkmin(5);
checkcgi();
?>
--FILE--
--EXPECTF--
X-Powered-By: PHP/%s
ETag: "3858f62230ac3c915f300c664312c63f"
-Cache-Control: public, must-revalidate, max_age=3600
+Cache-Control: public, must-revalidate, max-age=3600
Last-Modified: %s, %d %s 20%d %d:%d:%d GMT
Content-Type: %s
Accept-Ranges: bytes
Content-Length: 6
-foobar
\ No newline at end of file
+foobar
--SKIPIF--
<?php
include 'skip.inc';
-checkver(5);
+checkmin(5);
checkcgi();
checkext('zlib');
?>
--SKIPIF--
<?php
include 'skip.inc';
-checkver(5);
+checkmin(5);
checkcgi();
checkext('zlib');
?>
--EXPECTF--
X-Powered-By: PHP/%s
ETag: "%s"
-Cache-Control: public, must-revalidate, max_age=3600
+Cache-Control: public, must-revalidate, max-age=3600
Last-Modified: %s, %d %s 20%d %d:%d:%d GMT
Content-Type: %s
Accept-Ranges: bytes
--SKIPIF--
<?php
include 'skip.inc';
-checkver(5);
checkcgi();
+checkmin(5.1);
checkext('zlib');
?>
--ENV--
?>
--EXPECTF--
Status: 304
-Content-type: %s
X-Powered-By: PHP/%s
-Cache-Control: public, must-revalidate, max_age=3600
+Cache-Control: public, must-revalidate, max-age=3600
ETag: "80b285463881575891e86ba7bfecb4d0"
+Content-type: %s
<?php
include 'skip.inc';
checkcgi();
+checkmax(5.0);
?>
--FILE--
<?php
<?php
include 'skip.inc';
checkcgi();
+checkmax(5.0);
?>
--ENV--
HTTP_HOST=example.com
--- /dev/null
+--TEST--
+allowed methods
+--SKIPIF--
+<?php
+include 'skip.inc';
+checkcgi();
+checkmin(5.1);
+?>
+--FILE--
+<?php
+include 'log.inc';
+log_prepare(_AMETH_LOG);
+ini_set('http.allowed_methods', 'POST');
+echo "Done\n";
+?>
+--EXPECTF--
+Status: 405
+X-Powered-By: PHP/%s
+Allow: POST
+Content-type: %s
+
--- /dev/null
+--TEST--
+logging allowed methods
+--SKIPIF--
+<?php
+include 'skip.inc';
+checkcgi();
+checkmin(5.1);
+?>
+--ENV--
+HTTP_HOST=example.com
+--FILE--
+<?php
+echo "-TEST\n";
+include 'log.inc';
+log_content(_AMETH_LOG);
+echo "Done";
+?>
+--EXPECTF--
+%sTEST
+%d%d%d%d-%d%d-%d%d %d%d:%d%d:%d%d [405-ALLOWED] Allow: POST <%s>
+Done
--SKIPIF--
<?php
include 'skip.inc';
-checkver(5);
+checkmin(5);
checkcls('HttpRequest');
?>
--FILE--
<?php
include 'skip.inc';
checkcgi();
+checkmax(5.0);
?>
--FILE--
<?php
<?php
include 'skip.inc';
checkcgi();
+checkmax(5.0);
?>
--FILE--
<?php
<?php
include 'skip.inc';
checkcgi();
+checkmax(5.0);
?>
--FILE--
<?php
<?php
include 'skip.inc';
checkcgi();
+checkmax(5.0);
skipif(!http_support(HTTP_SUPPORT_MHASHETAGS), 'need mhash support');
skipif(!defined('HTTP_ETAG_MHASH_WHIRLPOOL'), 'need whirlpool mhash support');
?>
<?php
include 'skip.inc';
checkcgi();
+checkmax(5.0);
?>
--FILE--
<?php
<?php
include 'skip.inc';
checkcgi();
+checkmax(5.0);
skipif(!http_support(HTTP_SUPPORT_MHASHETAGS), 'need mhash support');
?>
--FILE--
<?php
include 'skip.inc';
checkcgi();
+checkmax(5.0);
?>
--FILE--
<?php
<?php
include 'skip.inc';
checkcgi();
+checkmax(5.0);
skipif(!http_support(HTTP_SUPPORT_MHASHETAGS), 'need mhash support');
skipif(!defined('HTTP_ETAG_MHASH_WHIRLPOOL'), 'need whirlpool mhash support');
?>
--- /dev/null
+--TEST--
+crc32 etag
+--SKIPIF--
+<?php
+include 'skip.inc';
+checkcgi();
+checkmin(5.1);
+?>
+--FILE--
+<?php
+ini_set('http.etag_mode', HTTP_ETAG_CRC32);
+http_cache_etag();
+http_send_data("abc\n");
+?>
+--EXPECTF--
+X-Powered-By: PHP/%s
+Cache-Control: private, must-revalidate, max-age=0
+Accept-Ranges: bytes
+ETag: "4e818847"
+Content-Length: 4
+Content-type: %s
+
+abc
--- /dev/null
+--TEST--
+sha1 etag
+--SKIPIF--
+<?php
+include 'skip.inc';
+checkcgi();
+checkmin(5.1);
+?>
+--FILE--
+<?php
+ini_set('http.etag_mode', HTTP_ETAG_SHA1);
+http_cache_etag();
+http_send_data("abc\n");
+?>
+--EXPECTF--
+X-Powered-By: PHP/%s
+Cache-Control: private, must-revalidate, max-age=0
+Accept-Ranges: bytes
+ETag: "03cfd743661f07975fa2f1220c5194cbaff48451"
+Content-Length: 4
+Content-type: %s
+
+abc
--- /dev/null
+--TEST--
+md5 etag
+--SKIPIF--
+<?php
+include 'skip.inc';
+checkcgi();
+checkmin(5.1);
+?>
+--FILE--
+<?php
+ini_set('http.etag_mode', HTTP_ETAG_MD5);
+http_cache_etag();
+http_send_data("abc\n");
+?>
+--EXPECTF--
+X-Powered-By: PHP/%s
+Cache-Control: private, must-revalidate, max-age=0
+Accept-Ranges: bytes
+ETag: "0bee89b07a248e27c83fc3d5951213c1"
+Content-Length: 4
+Content-type: %s
+
+abc
--- /dev/null
+--TEST--
+mhash etag
+--SKIPIF--
+<?php
+include 'skip.inc';
+checkcgi();
+checkmax(5.0);
+skipif(!http_support(HTTP_SUPPORT_MHASHETAGS), 'need mhash support');
+skipif(!defined('HTTP_ETAG_MHASH_WHIRLPOOL'), 'need whirlpool mhash support');
+?>
+--FILE--
+<?php
+ini_set('http.etag_mode', HTTP_ETAG_MHASH_WHIRLPOOL);
+http_cache_etag();
+http_send_data("abc\n");
+?>
+--EXPECTF--
+Content-type: %s
+X-Powered-By: PHP/%s
+Cache-Control: private, must-revalidate, max-age=0
+Accept-Ranges: bytes
+ETag: "53efa9e423f86dabd449b3e23dd0350def661b9e7055b23ceb2230c8b61bc0766514957ea9d349a88ef794715a1a17a409b549edfd6f43d696e63407fff3541c"
+Content-Length: 4
+
+abc
--- /dev/null
+--TEST--
+ob crc32 etag
+--SKIPIF--
+<?php
+include 'skip.inc';
+checkcgi();
+checkmin(5.1);
+?>
+--FILE--
+<?php
+ini_set('http.etag_mode', HTTP_ETAG_CRC32);
+http_cache_etag();
+print("abc\n");
+?>
+--EXPECTF--
+X-Powered-By: PHP/%s
+Cache-Control: private, must-revalidate, max-age=0
+ETag: "4e818847"
+Content-type: %s
+
+abc
--- /dev/null
+--TEST--
+ob sha1 etag
+--SKIPIF--
+<?php
+include 'skip.inc';
+checkcgi();
+checkmin(5.1);
+skipif(!http_support(HTTP_SUPPORT_MHASHETAGS), 'need mhash support');
+?>
+--FILE--
+<?php
+ini_set('http.etag_mode', HTTP_ETAG_SHA1);
+http_cache_etag();
+print("abc\n");
+?>
+--EXPECTF--
+X-Powered-By: PHP/%s
+Cache-Control: private, must-revalidate, max-age=0
+ETag: "03cfd743661f07975fa2f1220c5194cbaff48451"
+Content-type: %s
+
+abc
--- /dev/null
+--TEST--
+ob md5 etag
+--SKIPIF--
+<?php
+include 'skip.inc';
+checkcgi();
+checkmin(5.1);
+?>
+--FILE--
+<?php
+ini_set('http.etag_mode', HTTP_ETAG_MD5);
+http_cache_etag();
+print("abc\n");
+?>
+--EXPECTF--
+X-Powered-By: PHP/%s
+Cache-Control: private, must-revalidate, max-age=0
+ETag: "0bee89b07a248e27c83fc3d5951213c1"
+Content-type: %s
+
+abc
--- /dev/null
+--TEST--
+ob mhash etag
+--SKIPIF--
+<?php
+include 'skip.inc';
+checkcgi();
+checkmin(5.1);
+skipif(!http_support(HTTP_SUPPORT_MHASHETAGS), 'need mhash support');
+skipif(!defined('HTTP_ETAG_MHASH_WHIRLPOOL'), 'need whirlpool mhash support');
+?>
+--FILE--
+<?php
+ini_set('http.etag_mode', HTTP_ETAG_MHASH_WHIRLPOOL);
+http_cache_etag();
+print("abc\n");
+?>
+--EXPECTF--
+X-Powered-By: PHP/%s
+Cache-Control: private, must-revalidate, max-age=0
+ETag: "53efa9e423f86dabd449b3e23dd0350def661b9e7055b23ceb2230c8b61bc0766514957ea9d349a88ef794715a1a17a409b549edfd6f43d696e63407fff3541c"
+Content-type: %s
+
+abc
--SKIPIF--
<?php
include 'skip.inc';
-checkver(5.1);
+checkmin(5.1);
skipif(!http_support(HTTP_SUPPORT_MHASHETAGS), 'need mhash support');
skipif(!defined('HTTP_ETAG_MHASH_CRC32'), 'need CRC32 mhash support');
skipif(!defined('HTTP_ETAG_MHASH_CRC32B'), 'need CRC32B mhash support');
--SKIPIF--
<?php
include 'skip.inc';
-checkver(5);
+checkmin(5);
?>
--FILE--
<?php
<?php
include 'skip.inc';
checkcgi();
+checkmax(5.0);
?>
--ENV--
HTTP_HOST=localhost
?>
--EXPECTF--
Status: 302
-Content-type: text/html
+Content-type: %s
X-Powered-By: PHP/%s
Location: http://localhost/redirect?a=1&b=2
<?php
include 'skip.inc';
checkcgi();
+checkmax(5.0);
?>
--ENV--
HTTP_HOST=example.com
<?php
include 'skip.inc';
checkcgi();
+checkmax(5.0);
checkext('session');
?>
--ENV--
?>
--EXPECTF--
Status: 302
-Content-type: text/html
+Content-type: %s
X-Powered-By: PHP/%s
Set-Cookie: PHPSESSID=%s; path=/
Expires: %s
<?php
include 'skip.inc';
checkcgi();
+checkmax(5.0);
?>
--ENV--
HTTP_HOST=example.com
<?php
include 'skip.inc';
checkcgi();
+checkmax(5.0);
?>
--ENV--
HTTP_HOST=localhost
?>
--EXPECTF--
Status: 301
-Content-type: text/html
+Content-type: %s
X-Powered-By: PHP/%s
Location: http://localhost/redirect
<?php
include 'skip.inc';
checkcgi();
+checkmax(5.0);
?>
--ENV--
HTTP_HOST=example.com
--- /dev/null
+--TEST--
+http_redirect() with params
+--SKIPIF--
+<?php
+include 'skip.inc';
+checkcgi();
+checkmin(5.1);
+?>
+--ENV--
+HTTP_HOST=localhost
+--FILE--
+<?php
+include 'log.inc';
+log_prepare(_REDIR_LOG);
+http_redirect('redirect', array('a' => 1, 'b' => 2));
+?>
+--EXPECTF--
+Status: 302
+X-Powered-By: PHP/%s
+Location: http://localhost/redirect?a=1&b=2
+Content-type: %s
+
+Redirecting to <a href="http://localhost/redirect?a=1&b=2">http://localhost/redirect?a=1&b=2</a>.
+
--- /dev/null
+--TEST--
+logging redirects
+--SKIPIF--
+<?php
+include 'skip.inc';
+checkcgi();
+checkmin(5.1);
+?>
+--ENV--
+HTTP_HOST=example.com
+--FILE--
+<?php
+echo "-TEST\n";
+include 'log.inc';
+log_content(_REDIR_LOG);
+echo "Done";
+?>
+--EXPECTF--
+%sTEST
+%d%d%d%d-%d%d-%d%d %d%d:%d%d:%d%d [302-REDIRECT] Location: http%s <%s>
+Done
--- /dev/null
+--TEST--
+http_redirect() with session
+--SKIPIF--
+<?php
+include 'skip.inc';
+checkcgi();
+checkmin(5.1);
+checkext('session');
+?>
+--ENV--
+HTTP_HOST=localhost
+--FILE--
+<?php
+include 'log.inc';
+log_prepare(_REDIR_LOG);
+session_start();
+http_redirect('redirect', array('a' => 1), true);
+?>
+--EXPECTF--
+Status: 302
+X-Powered-By: PHP/%s
+Set-Cookie: PHPSESSID=%s; path=/
+Expires: %s
+Cache-Control: %s
+Pragma: %s
+Location: http://localhost/redirect?a=1&PHPSESSID=%s
+Content-type: %s
--- /dev/null
+--TEST--
+logging redirects
+--SKIPIF--
+<?php
+include 'skip.inc';
+checkcgi();
+checkmin(5.1);
+?>
+--ENV--
+HTTP_HOST=example.com
+--FILE--
+<?php
+echo "-TEST\n";
+include 'log.inc';
+log_content(_REDIR_LOG);
+echo "Done";
+?>
+--EXPECTF--
+%sTEST
+%d%d%d%d-%d%d-%d%d %d%d:%d%d:%d%d [302-REDIRECT] Location: http%s <%s>
+Done
--- /dev/null
+--TEST--
+http_redirect() permanent
+--SKIPIF--
+<?php
+include 'skip.inc';
+checkcgi();
+checkmin(5.1);
+?>
+--ENV--
+HTTP_HOST=localhost
+--FILE--
+<?php
+include 'log.inc';
+log_prepare(_REDIR_LOG);
+http_redirect('redirect', null, false, HTTP_REDIRECT_PERM);
+?>
+--EXPECTF--
+Status: 301
+X-Powered-By: PHP/%s
+Location: http://localhost/redirect
+Content-type: %s
+
+Redirecting to <a href="http://localhost/redirect">http://localhost/redirect</a>.
+
--- /dev/null
+--TEST--
+logging redirects
+--SKIPIF--
+<?php
+include 'skip.inc';
+checkcgi();
+checkmin(5.1);
+?>
+--ENV--
+HTTP_HOST=example.com
+--FILE--
+<?php
+echo "-TEST\n";
+include 'log.inc';
+log_content(_REDIR_LOG);
+echo "Done";
+?>
+--EXPECTF--
+%sTEST
+%d%d%d%d-%d%d-%d%d %d%d:%d%d:%d%d [301-REDIRECT] Location: http%s <%s>
+Done
<?php
include 'skip.inc';
checkcgi();
+checkmax(5.0);
?>
--ENV--
HTTP_IF_NONE_MATCH="0bee89b07a248e27c83fc3d5951213c1"
?>
--EXPECTF--
Status: 304
-Content-type: text/html
+Content-type: %s
X-Powered-By: PHP/%s
Cache-Control: private, must-revalidate, max-age=0
%s
<?php
include 'skip.inc';
checkcgi();
+checkmax(5.0);
?>
--ENV--
HTTP_HOST=example.com
<?php
include 'skip.inc';
checkcgi();
+checkmax(5.0);
?>
--FILE--
<?php
http_send_data('00000000000000000000');
?>
--EXPECTF--
-Content-type: text/html
+Content-type: %s
X-Powered-By: PHP/%s
Accept-Ranges: bytes
Content-Length: 20
-00000000000000000000
\ No newline at end of file
+00000000000000000000
<?php
include 'skip.inc';
checkcgi();
+checkmax(5.0);
?>
--FILE--
<?php
http_send_data("abc\n");
?>
--EXPECTF--
-Content-type: text/html
+Content-type: %s
X-Powered-By: PHP/%s
Cache-Control: private, must-revalidate, max-age=0
Last-Modified: %s, %d %s %d %d:%d:%d GMT
--- /dev/null
+--TEST--
+http_send_data() HTTP_SENDBUF_SIZE long string
+--SKIPIF--
+<?php
+include 'skip.inc';
+checkcgi();
+checkmin(5.1);
+?>
+--FILE--
+<?php
+http_throttle(0.01, 1);
+http_send_data('00000000000000000000');
+?>
+--EXPECTF--
+X-Powered-By: PHP/%s
+Accept-Ranges: bytes
+Content-Length: 20
+Content-type: %s
+
+00000000000000000000
--- /dev/null
+--TEST--
+http_send_data() last modified caching
+--SKIPIF--
+<?php
+include 'skip.inc';
+checkcgi();
+checkmin(5.1);
+?>
+--FILE--
+<?php
+http_cache_last_modified(-5);
+http_send_data("abc\n");
+?>
+--EXPECTF--
+X-Powered-By: PHP/%s
+Cache-Control: private, must-revalidate, max-age=0
+Last-Modified: %s, %d %s %d %d:%d:%d GMT
+Accept-Ranges: bytes
+Content-Length: 4
+Content-type: %s
+
+abc
<?php
include 'skip.inc';
checkcgi();
+checkmax(5.0);
?>
--FILE--
<?php
http_send_file('data.txt');
?>
--EXPECTF--
-Content-type: text/html
+Content-type: %s
X-Powered-By: PHP/%s
Accept-Ranges: bytes
Content-Length: 1010
<?php
include 'skip.inc';
checkcgi();
+checkmax(5.0);
?>
--ENV--
HTTP_RANGE=bytes=5-9
?>
--EXPECTF--
Status: 206
-Content-type: text/html
+Content-type: %s
X-Powered-By: PHP/%s
Accept-Ranges: bytes
Content-Range: bytes 5-9/1010
Content-Length: 5
-56789
\ No newline at end of file
+56789
<?php
include 'skip.inc';
checkcgi();
+checkmax(5.0);
?>
--ENV--
HTTP_RANGE=bytes=-9
?>
--EXPECTF--
Status: 206
-Content-type: text/html
+Content-type: %s
X-Powered-By: PHP/%s
Accept-Ranges: bytes
Content-Range: bytes 1001-1009/1010
<?php
include 'skip.inc';
checkcgi();
+checkmax(5.0);
?>
--ENV--
HTTP_RANGE=bytes=1000-
?>
--EXPECTF--
Status: 206
-Content-type: text/html
+Content-type: %s
X-Powered-By: PHP/%s
Accept-Ranges: bytes
Content-Range: bytes 1000-1009/1010
<?php
include 'skip.inc';
checkcgi();
+checkmax(5.0);
?>
--ENV--
HTTP_RANGE=bytes=xxx
http_send_file('data.txt');
?>
--EXPECTF--
-Content-type: text/html
+Content-type: %s
X-Powered-By: PHP/%s
Accept-Ranges: bytes
Content-Length: 1010
<?php
include 'skip.inc';
checkcgi();
+checkmax(5.0);
?>
--ENV--
HTTP_RANGE=bytes=-1111
?>
--EXPECTF--
Status: 416
-Content-type: text/html
+Content-type: %s
X-Powered-By: PHP/%s
--- /dev/null
+--TEST--
+http_send_file()
+--SKIPIF--
+<?php
+include 'skip.inc';
+checkcgi();
+checkmin(5.1);
+?>
+--FILE--
+<?php
+http_send_file('data.txt');
+?>
+--EXPECTF--
+X-Powered-By: PHP/%s
+Accept-Ranges: bytes
+Content-Length: 1010
+Content-type: %s
+
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
--- /dev/null
+--TEST--
+http_send_file() NUM-NUM range
+--SKIPIF--
+<?php
+include 'skip.inc';
+checkcgi();
+checkmin(5.1);
+?>
+--ENV--
+HTTP_RANGE=bytes=5-9
+--FILE--
+<?php
+http_send_file('data.txt');
+?>
+--EXPECTF--
+Status: 206
+X-Powered-By: PHP/%s
+Accept-Ranges: bytes
+Content-Range: bytes 5-9/1010
+Content-Length: 5
+Content-type: %s
+
+56789
--- /dev/null
+--TEST--
+http_send_file() NIL-NUM range
+--SKIPIF--
+<?php
+include 'skip.inc';
+checkcgi();
+checkmin(5.1);
+?>
+--ENV--
+HTTP_RANGE=bytes=-9
+--FILE--
+<?php
+http_send_file('data.txt');
+?>
+--EXPECTF--
+Status: 206
+X-Powered-By: PHP/%s
+Accept-Ranges: bytes
+Content-Range: bytes 1001-1009/1010
+Content-Length: 9
+Content-type: %s
+
+23456789
--- /dev/null
+--TEST--
+http_send_file() NUM-NIL range
+--SKIPIF--
+<?php
+include 'skip.inc';
+checkcgi();
+checkmin(5.1);
+?>
+--ENV--
+HTTP_RANGE=bytes=1000-
+--FILE--
+<?php
+http_send_file('data.txt');
+?>
+--EXPECTF--
+Status: 206
+X-Powered-By: PHP/%s
+Accept-Ranges: bytes
+Content-Range: bytes 1000-1009/1010
+Content-Length: 10
+Content-type: %s
+
+123456789
--- /dev/null
+--TEST--
+http_send_file() syntactically invalid range
+--SKIPIF--
+<?php
+include 'skip.inc';
+checkcgi();
+checkmin(5.1);
+?>
+--ENV--
+HTTP_RANGE=bytes=xxx
+--FILE--
+<?php
+http_send_file('data.txt');
+?>
+--EXPECTF--
+X-Powered-By: PHP/%s
+Accept-Ranges: bytes
+Content-Length: 1010
+Content-type: %s
+
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
--- /dev/null
+--TEST--
+http_send_file() oversized range
+--SKIPIF--
+<?php
+include 'skip.inc';
+checkcgi();
+checkmin(5.1);
+?>
+--ENV--
+HTTP_RANGE=bytes=-1111
+--FILE--
+<?php
+http_send_file('data.txt');
+?>
+--EXPECTF--
+Status: 416
+X-Powered-By: PHP/%s
+Content-type: %s
function skipif($if, $skip) { if ($if) { fprintf(STDOUT, "skip $skip"); exit(); }}
function checkcgi() { skipif(!strncasecmp('CLI', PHP_SAPI, 3), 'need CGI SAPI'); }
function checkext($ext) { skipif(!extension_loaded($ext), "need ext/$ext"); }
-function checkver($ver) { skipif(round($ver,1) > round((double) PHP_VERSION,1), "need PHP v$ver"); }
+function checkmin($ver) { skipif(round($ver,1) > round((double) PHP_VERSION,1), sprintf("need PHP >= v%0.1f",$ver)); }
+function checkmax($ver) { skipif(round($ver,1) < round((double) PHP_VERSION,1), sprintf("need PHP <= v%0.1f",$ver)); }
function checkurl($url) { skipif(!@fsockopen($url, 80), "$url not responsive"); }
function checkcls($cls) { skipif(!class_exists($cls), "need class $cls"); }
checkext('http');
--- /dev/null
+http://www.microsoft.com
+http://www.opensource.org
+http://www.google.com
+http://www.yahoo.com
+http://www.ibm.com
+http://www.mysql.com
+http://www.oracle.com
+http://www.ripe.net
+http://www.iana.org
+http://www.amazon.com
+http://www.netcraft.com
+http://www.heise.de
+http://www.chip.de
+http://www.ca.com
+http://www.cnet.com
+http://www.news.com
+http://www.cnn.com
+http://www.wikipedia.org
+http://www.dell.com
+http://www.hp.com
+http://www.cert.org
+http://www.mit.edu
+http://www.nist.gov
+http://www.ebay.com
+http://www.playstation.com
+http://www.uefa.com
+http://www.ieee.org
+http://www.apple.com
+http://www.sony.com
+http://www.symantec.com
+http://www.zdnet.com
+http://www.fujitsu.com
+http://www.supermicro.com
+http://www.hotmail.com
+http://www.ecma.com
+http://www.bbc.co.uk
+http://news.google.com
+http://www.foxnews.com
+http://www.msn.com
+http://www.wired.com
+http://www.sky.com
+http://www.usatoday.com
+http://www.cbs.com
+http://www.nbc.com
+http://slashdot.org
+http://www.bloglines.com
+http://www.techweb.com
+http://www.newslink.org
+http://www.un.org
\ No newline at end of file