1--TEST--
2Test sprintf() function : basic functionality - unsigned format
3--SKIPIF--
4<?php if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only"); ?>
5--FILE--
6<?php
7echo "*** Testing sprintf() : basic functionality - using unsigned format ***\n";
8
9
10// Initialise all required variables
11$format = "format";
12$format1 = "%u";
13$format2 = "%u %u";
14$format3 = "%u %u %u";
15$arg1 = -1111;
16$arg2 = -1234567;
17$arg3 = +2345432;
18
19// Calling sprintf() with default arguments
20var_dump( sprintf($format) );
21
22// Calling sprintf() with two arguments
23var_dump( sprintf($format1, $arg1) );
24
25// Calling sprintf() with three arguments
26var_dump( sprintf($format2, $arg1, $arg2) );
27
28// Calling sprintf() with four arguments
29var_dump( sprintf($format3, $arg1, $arg2, $arg3) );
30
31echo "Done";
32?>
33--EXPECT--
34*** Testing sprintf() : basic functionality - using unsigned format ***
35string(6) "format"
36string(20) "18446744073709550505"
37string(41) "18446744073709550505 18446744073708317049"
38string(49) "18446744073709550505 18446744073708317049 2345432"
39Done
40