PHP  
 PHP_HEAD
downloads | QA | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
 

Test Failure Report for ext/standard/tests/streams/bug64433.phpt ('Bug #60180 ($_SERVER["PHP_SELF"] incorrect)')

Script

1: <?php
2:
include __DIR__."/../../../../sapi/cli/tests/php_cli_server.inc";
3:
php_cli_server_start(file_get_contents(__DIR__.'/bug64433_srv.inc'));
4:
5: echo 
file_get_contents("http://".PHP_CLI_SERVER_ADDRESS."/index.php");
6: echo 
"default\n";
7:
$codes = array(200201204301302303304305307404500);
8: foreach(
$codes as $code) {
9:     echo 
"$code: ".file_get_contents("http://".PHP_CLI_SERVER_ADDRESS."/index.php?status=$code&loc=1");
10: }
11: echo 
"follow=0\n";
12:
$arr = array('http'=>
13:                         array(
14:                                 
'follow_location'=>0,
15:                         )
16:                 );
17:
$context stream_context_create($arr);
18: foreach(
$codes as $code) {
19:     echo 
"$code: ".file_get_contents("http://".PHP_CLI_SERVER_ADDRESS."/index.php?status=$code&loc=1"false$context);
20: }
21: echo 
"follow=1\n";
22:
$arr = array('http'=>
23:                         array(
24:                                 
'follow_location'=>1,
25:                         )
26:                 );
27:
$context stream_context_create($arr);
28: foreach(
$codes as $code) {
29:     echo 
"$code: ".file_get_contents("http://".PHP_CLI_SERVER_ADDRESS."/index.php?status=$code&loc=1"false$context);
30: }
31:

Expected

HELLO!
default
200: HELLO!
201: HELLO!
204: HELLO!
301: REDIRECTED
302: REDIRECTED
303: REDIRECTED
304: HELLO!
305: HELLO!
307: REDIRECTED
404: HELLO!
500: HELLO!
follow=0
200: HELLO!
201: HELLO!
204: HELLO!
301: HELLO!
302: HELLO!
303: HELLO!
304: HELLO!
305: HELLO!
307: HELLO!
404: HELLO!
500: HELLO!
follow=1
200: REDIRECTED
201: REDIRECTED
204: REDIRECTED
301: REDIRECTED
302: REDIRECTED
303: REDIRECTED
304: REDIRECTED
305: REDIRECTED
307: REDIRECTED
404: REDIRECTED
500: REDIRECTED

Output

Unable to connect to server

Diff

001+ Unable to connect to server
001- HELLO!
002- default
003- 200: HELLO!
004- 201: HELLO!
005- 204: HELLO!
006- 301: REDIRECTED
007- 302: REDIRECTED
008- 303: REDIRECTED
009- 304: HELLO!
010- 305: HELLO!
011- 307: REDIRECTED
012- 404: HELLO!
013- 500: HELLO!
014- follow=0
015- 200: HELLO!
016- 201: HELLO!
017- 204: HELLO!
018- 301: HELLO!
019- 302: HELLO!
020- 303: HELLO!
021- 304: HELLO!
022- 305: HELLO!
023- 307: HELLO!
024- 404: HELLO!
025- 500: HELLO!
026- follow=1
027- 200: REDIRECTED
028- 201: REDIRECTED
029- 204: REDIRECTED
030- 301: REDIRECTED
031- 302: REDIRECTED
032- 303: REDIRECTED
033- 304: REDIRECTED
034- 305: REDIRECTED
035- 307: REDIRECTED
036- 404: REDIRECTED
037- 500: REDIRECTED

 

Generated at Mon, 06 May 2019 17:58:35 +0000 (50 days ago)

Copyright © 2005-2019 The PHP Group
All rights reserved.