xref: /PHP-8.4/ext/standard/tests/file/002.phpt (revision 1b781219)
1--TEST--
2File/Stream functions
3--FILE--
4<?php
5
6$data = <<<EOD
7blah blah blah blah blah blah blah
8blah blah blah blah blah blah blah
9blah blah blah blah blah blah blah
10blah blah blah blah blah blah blah
11blah blah blah blah blah blah blah
12blah blah blah blah blah blah blah
13blah blah blah blah blah blah blah
14blah blah blah blah blah blah blah
15blah blah blah blah blah blah blah
16blah blah blah blah blah blah blah
17blah blah blah blah blah blah blah
18blah blah blah blah blah blah blah
19blah blah blah blah blah blah blah
20blah blah blah blah blah blah blah
21blah blah blah blah blah blah blah
22blah blah blah blah blah blah blah
23EOD;
24
25$name = tempnam(__DIR__, "php");
26$fp = fopen($name, "w");
27fwrite($fp, $data);
28fclose($fp);
29
30//readfile($name);
31echo file_get_contents($name);
32
33unlink($name);
34
35?>
36--EXPECT--
37blah blah blah blah blah blah blah
38blah blah blah blah blah blah blah
39blah blah blah blah blah blah blah
40blah blah blah blah blah blah blah
41blah blah blah blah blah blah blah
42blah blah blah blah blah blah blah
43blah blah blah blah blah blah blah
44blah blah blah blah blah blah blah
45blah blah blah blah blah blah blah
46blah blah blah blah blah blah blah
47blah blah blah blah blah blah blah
48blah blah blah blah blah blah blah
49blah blah blah blah blah blah blah
50blah blah blah blah blah blah blah
51blah blah blah blah blah blah blah
52blah blah blah blah blah blah blah
53