xref: /PHP-5.4/ext/standard/tests/file/bug44034.phpt (revision e2ab222c)
1--TEST--
2Bug #44034
3--INI--
4allow_url_fopen=1
5--FILE--
6<?php
7
8$urls = array();
9$urls[] = "data://text/plain,foo\r\nbar\r\n";
10$urls[] = "data://text/plain,\r\nfoo\r\nbar\r\n";
11$urls[] = "data://text/plain,foo\r\nbar";
12
13foreach($urls as $url) {
14	echo strtr($url, array("\r" => "\\r", "\n" => "\\n")) . "\n";
15	var_dump(file($url, FILE_IGNORE_NEW_LINES));
16}
17?>
18--EXPECTF--
19data://text/plain,foo\r\nbar\r\n
20array(2) {
21  [0]=>
22  %unicode|string%(3) "foo"
23  [1]=>
24  %unicode|string%(3) "bar"
25}
26data://text/plain,\r\nfoo\r\nbar\r\n
27array(3) {
28  [0]=>
29  %unicode|string%(0) ""
30  [1]=>
31  %unicode|string%(3) "foo"
32  [2]=>
33  %unicode|string%(3) "bar"
34}
35data://text/plain,foo\r\nbar
36array(2) {
37  [0]=>
38  %unicode|string%(3) "foo"
39  [1]=>
40  %unicode|string%(3) "bar"
41}
42