1--TEST--
2Chunked encoding
3--SKIPIF--
4<?php
5$filters = stream_get_filters();
6if(! in_array( "dechunk", $filters )) die( "chunked filter not available." );
7?>
8--INI--
9allow_url_fopen=1
10--FILE--
11<?php
12$streams = array(
13	"data://text/plain,0\r\n",
14	"data://text/plain,2\r\nte\r\n2\r\nst\r\n0\r\n",
15	"data://text/plain,2\nte\n2\nst\n0\n",
16	"data://text/plain,2;a=1\nte\n2;a=2;b=3\r\nst\n0\n",
17	"data://text/plain,2\nte\n2\nst\n0\na=b\r\nc=d\n\r\n",
18	"data://text/plain,1f\n0123456789abcdef0123456789abcde\n1\nf\n0\n",
19	"data://text/plain,1E\n0123456789abcdef0123456789abcd\n2\nef\n0\n",
20);
21foreach ($streams as $name) {
22	$fp = fopen($name, "r");
23	stream_filter_append($fp, "dechunk", STREAM_FILTER_READ);
24	var_dump(stream_get_contents($fp));
25	fclose($fp);
26}
27?>
28--EXPECT--
29string(0) ""
30string(4) "test"
31string(4) "test"
32string(4) "test"
33string(4) "test"
34string(32) "0123456789abcdef0123456789abcdef"
35string(32) "0123456789abcdef0123456789abcdef"
36