import zend standard tests
[hiphop-php.git] / hphp / test / zend / bad / ext-standard-strings / vfprintf_basic7.php
blobdab0f9f429bc496db92c80001676c0129abc69f8
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 */
7 echo "*** Testing vfprintf() : basic functionality - using unsigned format ***\n";
9 // Initialise all required variables
10 $format = "format";
11 $format1 = "%u";
12 $format2 = "%u %u";
13 $format3 = "%u %u %u";
14 $arg1 = array(-1111);
15 $arg2 = array(-1111,-1234567);
16 $arg3 = array(-1111,-1234567,-2345432);
18 /* creating dumping file */
19 $data_file = dirname(__FILE__) . '/vfprintf_basic7.phpt.txt';
20 if (!($fp = fopen($data_file, 'wt')))
21 return;
23 vfprintf($fp, $format1,$arg1);
24 fprintf($fp, "\n");
26 vfprintf($fp, $format2,$arg2);
27 fprintf($fp, "\n");
29 vfprintf($fp, $format3,$arg3);
30 fprintf($fp, "\n");
32 fclose($fp);
33 print_r(file_get_contents($data_file));
35 unlink($data_file);
38 ===DONE===