1--TEST-- 2Test vfprintf() function : basic functionality - octal 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 10echo "*** Testing vfprintf() : basic functionality - using octal format ***\n"; 11 12// Initialise all required variables 13$format = "format"; 14$format1 = "%o"; 15$format2 = "%o %o"; 16$format3 = "%o %o %o"; 17$arg1 = array(021); 18$arg2 = array(021,0347); 19$arg3 = array(021,0347,05678); 20 21/* creating dumping file */ 22$data_file = dirname(__FILE__) . '/vfprintf_basic8.txt'; 23if (!($fp = fopen($data_file, 'wt'))) 24 return; 25 26vfprintf($fp, $format1,$arg1); 27fprintf($fp, "\n"); 28 29vfprintf($fp, $format2,$arg2); 30fprintf($fp, "\n"); 31 32vfprintf($fp, $format3,$arg3); 33fprintf($fp, "\n"); 34 35fclose($fp); 36print_r(file_get_contents($data_file)); 37 38unlink($data_file); 39?> 40===DONE=== 41--EXPECT-- 42*** Testing vfprintf() : basic functionality - using octal format *** 4321 4421 347 4521 347 567 46===DONE=== 47