1--TEST-- 2Test vfprintf() function : basic functionality - integer format 3--FILE-- 4<?php 5/* Prototype : int vfprintf ( resource $handle , string $format , array $args ) 6 * Description: Write a formatted string to a stream 7 * Source code: ext/standard/formatted_print.c 8*/ 9 10/* 11 * Testing vfprintf() : basic functionality - using integer format 12*/ 13 14echo "*** Testing vfprintf() : basic functionality - using integer format ***\n"; 15 16// Initialise all required variables 17$format = "format"; 18$format1 = "%d"; 19$format2 = "%d %d"; 20$format3 = "%d %d %d"; 21$arg1 = array(111); 22$arg2 = array(111,222); 23$arg3 = array(111,222,333); 24 25/* creating dumping file */ 26$data_file = dirname(__FILE__) . '/dump.txt'; 27if (!($fp = fopen($data_file, 'wt'))) 28 return; 29 30vfprintf($fp, $format1, $arg1); 31fprintf($fp, "\n"); 32 33vfprintf($fp, $format2, $arg2); 34fprintf($fp, "\n"); 35 36vfprintf($fp, $format3, $arg3); 37fprintf($fp, "\n"); 38 39fclose($fp); 40print_r(file_get_contents($data_file)); 41 42unlink($data_file); 43 44?> 45===DONE=== 46--EXPECT-- 47*** Testing vfprintf() : basic functionality - using integer format *** 48111 49111 222 50111 222 333 51===DONE=== 52 53 54