1--TEST-- 2Test readfile() function: usage variation - stream_context 3--FILE-- 4<?php 5/* test readfile() with third argument : context */ 6 7// include file.inc 8require("file.inc"); 9$file_path = __DIR__; 10 11/* Variation 1 : Check working of third argument of readfile() */ 12 13echo "*** Testing readfile(): checking third argument ***\n"; 14// creating a context 15$context = stream_context_create(); 16// temp file name used here 17$filename = "$file_path/readfile_variation1.tmp"; 18 19// create file 20$fp = fopen($filename, "w"); 21fill_file($fp, "text_with_new_line", 50); 22fclose($fp); 23$count = readfile($filename, true, $context); 24echo "\n"; 25var_dump($count); 26 27echo "Done\n"; 28?> 29--CLEAN-- 30<?php 31unlink(__DIR__."/readfile_variation1.tmp"); 32?> 33--EXPECT-- 34*** Testing readfile(): checking third argument *** 35line 36line of text 37line 38line of text 39line 40line of t 41int(50) 42Done 43