1--TEST--
2Stream: RFC2397 decoding data
3--INI--
4allow_url_fopen=1
5--FILE--
6<?php
7
8$streams = array(
9    'data://,A%20brief%20note',
10    'data://application/vnd-xxx-query,select_vcount,fcol_from_fieldtable/local',
11    'data://;base64,Zm9vYmFyIGZvb2Jhcg==',
12    'stream_rfc2397_003.gif' => 'data://image/gif;base64,R0lGODdhMAAwAPAAAAAAAP///ywAAAAAMAAw
13AAAC8IyPqcvt3wCcDkiLc7C0qwyGHhSWpjQu5yqmCYsapyuvUUlvONmOZtfzgFz
14ByTB10QgxOR0TqBQejhRNzOfkVJ+5YiUqrXF5Y5lKh/DeuNcP5yLWGsEbtLiOSp
15a/TPg7JpJHxyendzWTBfX0cxOnKPjgBzi4diinWGdkF8kjdfnycQZXZeYGejmJl
16ZeGl9i2icVqaNVailT6F5iJ90m6mvuTS4OK05M0vDk0Q4XUtwvKOzrcd3iq9uis
17F81M1OIcR7lEewwcLp7tuNNkM3uNna3F2JQFo97Vriy/Xl4/f1cf5VWzXyym7PH
18hhx4dbgYKAAA7',
19    );
20
21foreach($streams as $original => $stream)
22{
23    if (is_string($original)) {
24        var_dump(file_get_contents(__DIR__ . '/' . $original) == file_get_contents($stream));
25    } else {
26        var_dump(file_get_contents($stream));
27    }
28}
29
30?>
31--EXPECT--
32string(12) "A brief note"
33string(40) "select_vcount,fcol_from_fieldtable/local"
34string(13) "foobar foobar"
35bool(true)
36