1--TEST--
2Test printf() function : basic functionality - unsigned format
3--SKIPIF--
4<?php
5if (PHP_INT_SIZE != 4) {
6        die("skip this test is for 32bit platform only");
7}
8?>
9--FILE--
10<?php
11echo "*** Testing printf() : basic functionality - using unsigned format ***\n";
12
13
14// Initialise all required variables
15$format = "format";
16$format1 = "%u";
17$format2 = "%u %u";
18$format3 = "%u %u %u";
19$arg1 = -1111;
20$arg2 = -1234567;
21$arg3 = +2345432;
22
23echo "\n-- Calling printf() with no arguments --\n";
24$result = printf($format);
25echo "\n";
26var_dump($result);
27
28echo "\n-- Calling printf() with one arguments --\n";
29$result = printf($format1, $arg1);
30echo "\n";
31var_dump($result);
32
33echo "\n-- Calling printf() with two arguments --\n";
34$result = printf($format2, $arg1, $arg2);
35echo "\n";
36var_dump($result);
37
38echo "\n-- Calling printf() with three arguments --\n";
39$result = printf($format3, $arg1, $arg2, $arg3);
40echo "\n";
41var_dump($result);
42
43?>
44--EXPECT--
45*** Testing printf() : basic functionality - using unsigned format ***
46
47-- Calling printf() with no arguments --
48format
49int(6)
50
51-- Calling printf() with one arguments --
524294966185
53int(10)
54
55-- Calling printf() with two arguments --
564294966185 4293732729
57int(21)
58
59-- Calling printf() with three arguments --
604294966185 4293732729 2345432
61int(29)
62