Annotation of embedaddon/php/ext/standard/tests/file/bug44034.phpt, revision 1.1.1.2
1.1 misho 1: --TEST--
2: Bug #44034
1.1.1.2 ! misho 3: --INI--
! 4: allow_url_fopen=1
1.1 misho 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:
13: foreach($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--
19: data://text/plain,foo\r\nbar\r\n
20: array(2) {
21: [0]=>
22: %unicode|string%(3) "foo"
23: [1]=>
24: %unicode|string%(3) "bar"
25: }
26: data://text/plain,\r\nfoo\r\nbar\r\n
27: array(3) {
28: [0]=>
29: %unicode|string%(0) ""
30: [1]=>
31: %unicode|string%(3) "foo"
32: [2]=>
33: %unicode|string%(3) "bar"
34: }
35: data://text/plain,foo\r\nbar
36: array(2) {
37: [0]=>
38: %unicode|string%(3) "foo"
39: [1]=>
40: %unicode|string%(3) "bar"
41: }
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>