Test: /ext/standard/tests/http/bug38802.phpt - Version 5.4.33        

Bug #38802 'max_redirects' context options doesn't work when value is 1
Submitted: 2006-09-13 07:36:04 Modified: 2010-02-17 00:35:40
From: datibbaw Assigned:
Status: Closed Package: HTTP related
PHP Version: 5.2.9 OS: Linux Gentoo

There are 4 different diffs reported by users for this test.

Count Diff
14 (82%)
003+ array(2) {
004+ ["headers"]=>
005+ array(0) {
006+ }
007+ ["readbuf"]=>
008+ resource(10) of type (stream)
009+ }
010+ string(5) "done."
011+ string(343) "GET /foo/bar HTTP/1.1
012+ User-Agent: PHP/5.4.33
013+ Host: 127.0.0.1:12342
014+ Accept: */*
015+
016+ GET /foo/bar2 HTTP/1.0
017+ User-Agent: PHP/5.4.33
003- array(7) {
004- [0]=>
005- string(30) "HTTP/1.0 302 Moved Temporarily"
006- [1]=>
007- string(41) "Location: http://127.0.0.1:12342/foo/bar2"
008- [2]=>
009- string(30) "HTTP/1.0 301 Moved Permanently"
010- [3]=>
011- string(41) "Location: http://127.0.0.1:12342/foo/bar3"
012- [4]=>
013- string(30) "HTTP/1.0 302 Moved Temporarily"
014- [5]=>
015- string(41) "Location: http://127.0.0.1:12342/foo/bar4"
016- [6]=>
017- string(15) "HTTP/1.0 200 OK"
018- }
019- string(5) "done."
020- string(195) "GET /foo/bar HTTP/1.0
019+ Accept: */*
021+ GET /foo/bar3 HTTP/1.0
022+ User-Agent: PHP/5.4.33
023- GET /foo/bar2 HTTP/1.0
024+ Accept: */*
026+ GET /foo/bar4 HTTP/1.0
027+ User-Agent: PHP/5.4.33
026- GET /foo/bar3 HTTP/1.0
029+ Accept: */*
029- GET /foo/bar4 HTTP/1.0
030- Host: 127.0.0.1:12342
031-
033+ resource(15) of type (stream)
034+ array(2) {
035+ ["headers"]=>
036+ array(0) {
037+ }
038+ ["readbuf"]=>
039+ resource(16) of type (stream)
040+ }
041+ string(0) ""
042+ string(257) "GET /foo/bar HTTP/1.1
043+ User-Agent: PHP/5.4.33
034-
035- Warning: fopen(http://127.0.0.1:12342/foo/bar): failed to open stream: Redirection limit reached, aborting in %s
036- bool(false)
037- string(97) "GET /foo/bar HTTP/1.0
045+ Accept: */*
045-
046- Warning: fopen(http://127.0.0.1:12342/foo/bar): failed to open stream: Redirection limit reached, aborting in %s
047- bool(false)
048- string(48) "GET /foo/bar HTTP/1.0
048+ User-Agent: PHP/5.4.33
050+ Accept: */*
052+ GET /foo/bar3 HTTP/1.0
053+ User-Agent: PHP/5.4.33
054+ Host: 127.0.0.1:12342
055+ Accept: */*
056+
053-
054- Warning: fopen(http://127.0.0.1:12342/foo/bar): failed to open stream: Redirection limit reached, aborting in %s
055- bool(false)
056- string(48) "GET /foo/bar HTTP/1.0
059+ resource(21) of type (stream)
060+ array(2) {
061+ ["headers"]=>
062+ array(0) {
063+ }
064+ ["readbuf"]=>
065+ resource(22) of type (stream)
066+ }
067+ string(1) "1"
068+ string(85) "GET /foo/bar HTTP/1.1
069+ User-Agent: PHP/5.4.33
063- [0]=>
064- string(30) "HTTP/1.0 302 Moved Temporarily"
065- [1]=>
066- string(41) "Location: http://127.0.0.1:12342/foo/bar2"
069- string(48) "GET /foo/bar HTTP/1.0
071+ Accept: */*
075+ resource(27) of type (stream)
076+ array(2) {
077+ ["headers"]=>
078+ array(0) {
079+ }
080+ ["readbuf"]=>
081+ resource(28) of type (stream)
082+ }
083+ string(1) "1"
084+ string(85) "GET /foo/bar HTTP/1.1
085+ User-Agent: PHP/5.4.33
076- [0]=>
077- string(30) "HTTP/1.0 302 Moved Temporarily"
078- [1]=>
079- string(41) "Location: http://127.0.0.1:12342/foo/bar2"
082- string(48) "GET /foo/bar HTTP/1.0
087+ Accept: */*
088- array(4) {
089- [0]=>
090- string(30) "HTTP/1.0 302 Moved Temporarily"
091- [1]=>
092- string(41) "Location: http://127.0.0.1:12342/foo/bar2"
093- [2]=>
094- string(30) "HTTP/1.0 301 Moved Permanently"
095- [3]=>
096- string(41) "Location: http://127.0.0.1:12342/foo/bar3"
093+ ["headers"]=>
094+ array(0) {
095+ }
096+ ["readbuf"]=>
097+ resource(34) of type (stream)
099- string(97) "GET /foo/bar HTTP/1.0
100+ string(85) "GET /foo/bar HTTP/1.1
101+ User-Agent: PHP/5.4.33
103+ Accept: */*
109+ ["headers"]=>
110+ array(0) {
111+ }
112+ ["readbuf"]=>
113+ resource(40) of type (stream)
116+ string(85) "GET /foo/bar HTTP/1.1
117+ User-Agent: PHP/5.4.33
119+ Accept: */*
124+ array(2) {
125+ ["headers"]=>
126+ array(0) {
127+ }
128+ ["readbuf"]=>
129+ resource(46) of type (stream)
132+ string(257) "GET /foo/bar HTTP/1.1
133+ User-Agent: PHP/5.4.33
135+ Accept: */*
138+ User-Agent: PHP/5.4.33
140+ Accept: */*
142+ GET /foo/bar3 HTTP/1.0
143+ User-Agent: PHP/5.4.33
144+ Host: 127.0.0.1:12342
145+ Accept: */*
146+
1 (6%)
003+ array(2) {
004+ ["headers"]=>
005+ array(2) {
006+ [0]=>
007+ string(30) "HTTP/1.0 302 Moved Temporarily"
008+ [1]=>
009+ string(41) "Location: http://127.0.0.1:12342/foo/bar2"
010+ }
011+ ["readbuf"]=>
012+ resource(10) of type (stream)
003- array(7) {
004- [0]=>
005- string(30) "HTTP/1.0 302 Moved Temporarily"
006- [1]=>
007- string(41) "Location: http://127.0.0.1:12342/foo/bar2"
008- [2]=>
009- string(30) "HTTP/1.0 301 Moved Permanently"
010- [3]=>
011- string(41) "Location: http://127.0.0.1:12342/foo/bar3"
012- [4]=>
013- string(30) "HTTP/1.0 302 Moved Temporarily"
014- [5]=>
015- string(41) "Location: http://127.0.0.1:12342/foo/bar4"
016- [6]=>
017- string(15) "HTTP/1.0 200 OK"
015+ string(343) "GET /foo/bar HTTP/1.1
016+ User-Agent: PHP/5.4.33
018+ Accept: */*
020- string(195) "GET /foo/bar HTTP/1.0
021+ User-Agent: PHP/5.4.33
023+ Accept: */*
026+ User-Agent: PHP/5.4.33
028+ Accept: */*
031+ User-Agent: PHP/5.4.33
033+ Accept: */*
034-
035- Warning: fopen(http://127.0.0.1:12342/foo/bar): failed to open stream: Redirection limit reached, aborting in %s
036- bool(false)
037- string(97) "GET /foo/bar HTTP/1.0
037+ resource(15) of type (stream)
038+ array(2) {
039+ ["headers"]=>
040+ array(0) {
041+ }
042+ ["readbuf"]=>
043+ resource(16) of type (stream)
044+ }
045+ string(0) ""
046+ string(257) "GET /foo/bar HTTP/1.1
047+ User-Agent: PHP/5.4.33
045-
046- Warning: fopen(http://127.0.0.1:12342/foo/bar): failed to open stream: Redirection limit reached, aborting in %s
047- bool(false)
048- string(48) "GET /foo/bar HTTP/1.0
049+ Accept: */*
052+ User-Agent: PHP/5.4.33
053-
054- Warning: fopen(http://127.0.0.1:12342/foo/bar): failed to open stream: Redirection limit reached, aborting in %s
055- bool(false)
056- string(48) "GET /foo/bar HTTP/1.0
054+ Accept: */*
056+ GET /foo/bar3 HTTP/1.0
057+ User-Agent: PHP/5.4.33
058+ Host: 127.0.0.1:12342
059+ Accept: */*
060+
063+ resource(21) of type (stream)
064+ array(2) {
065+ ["headers"]=>
066+ array(0) {
067+ }
068+ ["readbuf"]=>
069+ resource(22) of type (stream)
070+ }
071+ string(1) "1"
072+ string(85) "GET /foo/bar HTTP/1.1
073+ User-Agent: PHP/5.4.33
063- [0]=>
064- string(30) "HTTP/1.0 302 Moved Temporarily"
065- [1]=>
066- string(41) "Location: http://127.0.0.1:12342/foo/bar2"
069- string(48) "GET /foo/bar HTTP/1.0
075+ Accept: */*
076- [0]=>
077- string(30) "HTTP/1.0 302 Moved Temporarily"
078- [1]=>
079- string(41) "Location: http://127.0.0.1:12342/foo/bar2"
079+ resource(27) of type (stream)
080+ array(2) {
081+ ["headers"]=>
082+ array(0) {
083+ }
084+ ["readbuf"]=>
085+ resource(28) of type (stream)
086+ }
087+ string(1) "1"
088+ string(85) "GET /foo/bar HTTP/1.1
089+ User-Agent: PHP/5.4.33
082- string(48) "GET /foo/bar HTTP/1.0
088- array(4) {
089- [0]=>
090- string(30) "HTTP/1.0 302 Moved Temporarily"
091- [1]=>
092- string(41) "Location: http://127.0.0.1:12342/foo/bar2"
093- [2]=>
094- string(30) "HTTP/1.0 301 Moved Permanently"
095- [3]=>
096- string(41) "Location: http://127.0.0.1:12342/foo/bar3"
091+ Accept: */*
097+ ["headers"]=>
098+ array(0) {
099+ }
100+ ["readbuf"]=>
101+ resource(34) of type (stream)
099- string(97) "GET /foo/bar HTTP/1.0
104+ string(85) "GET /foo/bar HTTP/1.1
105+ User-Agent: PHP/5.4.33
107+ Accept: */*
113+ ["headers"]=>
114+ array(0) {
115+ }
116+ ["readbuf"]=>
117+ resource(40) of type (stream)
120+ string(85) "GET /foo/bar HTTP/1.1
121+ User-Agent: PHP/5.4.33
123+ Accept: */*
128+ array(2) {
129+ ["headers"]=>
130+ array(0) {
131+ }
132+ ["readbuf"]=>
133+ resource(46) of type (stream)
136+ string(257) "GET /foo/bar HTTP/1.1
137+ User-Agent: PHP/5.4.33
139+ Accept: */*
142+ User-Agent: PHP/5.4.33
144+ Accept: */*
146+ GET /foo/bar3 HTTP/1.0
147+ User-Agent: PHP/5.4.33
148+ Host: 127.0.0.1:12342
149+ Accept: */*
150+
1 (6%)
003+ array(2) {
004+ ["headers"]=>
005+ array(0) {
006+ }
007+ ["readbuf"]=>
008+ resource(10) of type (stream)
009+ }
010+ string(5) "done."
011+ string(343) "GET /foo/bar HTTP/1.1
012+ User-Agent: PHP/5.4.33
013+ Host: 127.0.0.1:12342
014+ Accept: */*
015+
016+ GET /foo/bar2 HTTP/1.0
017+ User-Agent: PHP/5.4.33
003- array(7) {
004- [0]=>
005- string(30) "HTTP/1.0 302 Moved Temporarily"
006- [1]=>
007- string(41) "Location: http://127.0.0.1:12342/foo/bar2"
008- [2]=>
009- string(30) "HTTP/1.0 301 Moved Permanently"
010- [3]=>
011- string(41) "Location: http://127.0.0.1:12342/foo/bar3"
012- [4]=>
013- string(30) "HTTP/1.0 302 Moved Temporarily"
014- [5]=>
015- string(41) "Location: http://127.0.0.1:12342/foo/bar4"
016- [6]=>
017- string(15) "HTTP/1.0 200 OK"
018- }
019- string(5) "done."
020- string(195) "GET /foo/bar HTTP/1.0
019+ Accept: */*
021+ GET /foo/bar3 HTTP/1.0
022+ User-Agent: PHP/5.4.33
023- GET /foo/bar2 HTTP/1.0
024+ Accept: */*
026+ GET /foo/bar4 HTTP/1.0
027+ User-Agent: PHP/5.4.33
026- GET /foo/bar3 HTTP/1.0
029+ Accept: */*
029- GET /foo/bar4 HTTP/1.0
030- Host: 127.0.0.1:12342
031-
033+ resource(15) of type (stream)
034+ array(2) {
035+ ["headers"]=>
036+ array(0) {
037+ }
038+ ["readbuf"]=>
039+ resource(16) of type (stream)
040+ }
041+ string(0) ""
042+ string(257) "GET /foo/bar HTTP/1.1
043+ User-Agent: PHP/5.4.33
034-
035- Warning: fopen(http://127.0.0.1:12342/foo/bar): failed to open stream: Redirection limit reached, aborting in %s
036- bool(false)
037- string(97) "GET /foo/bar HTTP/1.0
045+ Accept: */*
045-
046- Warning: fopen(http://127.0.0.1:12342/foo/bar): failed to open stream: Redirection limit reached, aborting in %s
047- bool(false)
048- string(48) "GET /foo/bar HTTP/1.0
048+ User-Agent: PHP/5.4.33
050+ Accept: */*
052+ GET /foo/bar3 HTTP/1.0
053+ User-Agent: PHP/5.4.33
054+ Host: 127.0.0.1:12342
055+ Accept: */*
056+
053-
054- Warning: fopen(http://127.0.0.1:12342/foo/bar): failed to open stream: Redirection limit reached, aborting in %s
055- bool(false)
056- string(48) "GET /foo/bar HTTP/1.0
059+ resource(21) of type (stream)
060+ array(2) {
061+ ["headers"]=>
062+ array(0) {
063+ }
064+ ["readbuf"]=>
065+ resource(22) of type (stream)
066+ }
067+ string(1) "1"
068+ string(85) "GET /foo/bar HTTP/1.1
069+ User-Agent: PHP/5.4.33
063- [0]=>
064- string(30) "HTTP/1.0 302 Moved Temporarily"
065- [1]=>
066- string(41) "Location: http://127.0.0.1:12342/foo/bar2"
069- string(48) "GET /foo/bar HTTP/1.0
071+ Accept: */*
075+ resource(27) of type (stream)
076+ array(2) {
077+ ["headers"]=>
078+ array(0) {
079+ }
080+ ["readbuf"]=>
081+ resource(28) of type (stream)
082+ }
083+ string(1) "1"
084+ string(85) "GET /foo/bar HTTP/1.1
085+ User-Agent: PHP/5.4.33
076- [0]=>
077- string(30) "HTTP/1.0 302 Moved Temporarily"
078- [1]=>
079- string(41) "Location: http://127.0.0.1:12342/foo/bar2"
082- string(48) "GET /foo/bar HTTP/1.0
087+ Accept: */*
088- array(4) {
089- [0]=>
090- string(30) "HTTP/1.0 302 Moved Temporarily"
091- [1]=>
092- string(41) "Location: http://127.0.0.1:12342/foo/bar2"
093- [2]=>
094- string(30) "HTTP/1.0 301 Moved Permanently"
095- [3]=>
096- string(41) "Location: http://127.0.0.1:12342/foo/bar3"
093+ ["headers"]=>
094+ array(2) {
095+ [0]=>
096+ string(30) "HTTP/1.0 302 Moved Temporarily"
097+ [1]=>
098+ string(41) "Location: http://127.0.0.1:12342/foo/bar2"
099+ }
100+ ["readbuf"]=>
101+ resource(34) of type (stream)
099- string(97) "GET /foo/bar HTTP/1.0
104+ string(85) "GET /foo/bar HTTP/1.1
105+ User-Agent: PHP/5.4.33
107+ Accept: */*
113+ ["headers"]=>
114+ array(0) {
115+ }
116+ ["readbuf"]=>
117+ resource(40) of type (stream)
120+ string(85) "GET /foo/bar HTTP/1.1
121+ User-Agent: PHP/5.4.33
123+ Accept: */*
128+ array(2) {
129+ ["headers"]=>
130+ array(0) {
131+ }
132+ ["readbuf"]=>
133+ resource(46) of type (stream)
136+ string(257) "GET /foo/bar HTTP/1.1
137+ User-Agent: PHP/5.4.33
139+ Accept: */*
142+ User-Agent: PHP/5.4.33
144+ Accept: */*
146+ GET /foo/bar3 HTTP/1.0
147+ User-Agent: PHP/5.4.33
148+ Host: 127.0.0.1:12342
149+ Accept: */*
150+
1 (6%)