Annotation of embedaddon/php/ext/standard/tests/strings/sprintf_basic7_64bit.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Test 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
7: /* Prototype : string sprintf(string $format [, mixed $arg1 [, mixed ...]])
8: * Description: Return a formatted string
9: * Source code: ext/standard/formatted_print.c
10: */
11:
12: echo "*** Testing sprintf() : basic functionality - using unsigned format ***\n";
13:
14:
15: // Initialise all required variables
16: $format = "format";
17: $format1 = "%u";
18: $format2 = "%u %u";
19: $format3 = "%u %u %u";
20: $arg1 = -1111;
21: $arg2 = -1234567;
22: $arg3 = +2345432;
23:
24: // Calling sprintf() with default arguments
25: var_dump( sprintf($format) );
26:
27: // Calling sprintf() with two arguments
28: var_dump( sprintf($format1, $arg1) );
29:
30: // Calling sprintf() with three arguments
31: var_dump( sprintf($format2, $arg1, $arg2) );
32:
33: // Calling sprintf() with four arguments
34: var_dump( sprintf($format3, $arg1, $arg2, $arg3) );
35:
36: echo "Done";
37: ?>
38: --EXPECTF--
39: *** Testing sprintf() : basic functionality - using unsigned format ***
40: string(6) "format"
41: string(20) "18446744073709550505"
42: string(41) "18446744073709550505 18446744073708317049"
43: string(49) "18446744073709550505 18446744073708317049 2345432"
44: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>