import zend standard tests
[hiphop-php.git] / hphp / test / zend / good / ext-standard-strings / vfprintf_basic6.php
blob6fe6f835d3208dbaac689e029da443bdb170449d
1 <?php
2 /* Prototype : int vfprintf ( resource $handle , string $format , array $args )
3 * Description: Write a formatted string to a stream
4 * Source code: ext/standard/formatted_print.c
5 */
8 echo "*** Testing vfprintf() : basic functionality - using exponential format ***\n";
10 // Initialise all required variables
11 $format = "format";
12 $format1 = "%e";
13 $format2 = "%e %e";
14 $format3 = "%e %e %e";
15 $arg1 = array(1000);
16 $arg2 = array(1000,2000);
17 $arg3 = array(1000,2000,3000);
19 /* creating dumping file */
20 $data_file = dirname(__FILE__) . '/vfprintf_basic6.phpt.txt';
21 if (!($fp = fopen($data_file, 'wt')))
22 return;
24 vfprintf($fp, $format1,$arg1);
25 fprintf($fp, "\n");
27 vfprintf($fp, $format2,$arg2);
28 fprintf($fp, "\n");
30 vfprintf($fp, $format3,$arg3);
31 fprintf($fp, "\n");
33 fclose($fp);
34 print_r(file_get_contents($data_file));
36 unlink($data_file);
39 ===DONE===