1--TEST-- 2Test vfprintf() function : basic functionality - string format 3--FILE-- 4<?php 5echo "*** Testing vfprintf() : basic functionality - using string format ***\n"; 6 7// Initialise all required variables 8$format = "format"; 9$format1 = "%s\n"; 10$format2 = "%s %s\n"; 11$format3 = "%s %s %s\n"; 12$arg1 = array("one"); 13$arg2 = array("one","two"); 14$arg3 = array("one","two","three"); 15 16 17/* creating dumping file */ 18$data_file = __DIR__ . '/vfprintf_basic1.txt'; 19if (!($fp = fopen($data_file, 'wt'))) 20 return; 21 22$result = vfprintf($fp, $format1, $arg1); 23var_dump($result); 24$result = vfprintf($fp, $format2, $arg2); 25var_dump($result); 26$result = vfprintf($fp, $format3, $arg3); 27var_dump($result); 28 29fclose($fp); 30print_r(file_get_contents($data_file)); 31 32unlink($data_file); 33 34?> 35--EXPECT-- 36*** Testing vfprintf() : basic functionality - using string format *** 37int(4) 38int(8) 39int(14) 40one 41one two 42one two three 43