1--TEST--
2Test vfprintf() function : basic functionality - unsigned format
3--SKIPIF--
4<?php
5if (PHP_INT_SIZE != 4) die("skip this test is for 32bit platform only");
6?>
7--FILE--
8<?php
9/* Prototype  : int vfprintf  ( resource $handle  , string $format , array $args  )
10 * Description: Write a formatted string to a stream
11 * Source code: ext/standard/formatted_print.c
12*/
13
14echo "*** Testing vfprintf() : basic functionality - using unsigned format ***\n";
15
16// Initialise all required variables
17$format = "format";
18$format1 = "%u";
19$format2 = "%u %u";
20$format3 = "%u %u %u";
21$arg1 = array(-1111);
22$arg2 = array(-1111,-1234567);
23$arg3 = array(-1111,-1234567,-2345432);
24
25/* creating dumping file */
26$data_file = dirname(__FILE__) . '/vfprintf_basic7.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 unsigned format ***
484294966185
494294966185 4293732729
504294966185 4293732729 4292621864
51===DONE===
52
53
54