readfile_variation1.phpt [plain text]
--TEST--
Test readfile() function: usage variation - stream_context
--FILE--
<?php
require("file.inc");
$file_path = dirname(__FILE__);
echo "*** Testing readfile(): checking third argument ***\n";
$context = stream_context_create();
$filename = "$file_path/readfile_variation1.tmp";
$fp = fopen($filename, "w");
fill_file($fp, "text_with_new_line", 50);
fclose($fp);
$count = readfile($filename, true, $context);
echo "\n";
var_dump($count);
echo "Done\n";
?>
--CLEAN--
<?php
unlink(dirname(__FILE__)."/readfile_variation1.tmp");
?>
--EXPECT--
*** Testing readfile(): checking third argument ***
line
line of text
line
line of text
line
line of t
int(50)
Done