1--TEST--
2Test vfprintf() function : basic functionality - unsigned format
3--SKIPIF--
4<?php
5if (PHP_INT_SIZE != 8) die("skip this test is for 64bit 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_64bit.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 ***
4818446744073709550505
4918446744073709550505 18446744073708317049
5018446744073709550505 18446744073708317049 18446744073707206184
51===DONE===
52