1--TEST--
2Test sprintf() function : basic functionality - octal 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 octal format ***\n";
8
9// Initialise all required variables
10$format = "format";
11$format1 = "%o";
12$format2 = "%o %o";
13$format3 = "%o %o %o";
14$arg1 = 021;
15$arg2 = -0347;
16$arg3 = 0567;
17
18// Calling sprintf() with default arguments
19var_dump( sprintf($format) );
20
21// Calling sprintf() with two arguments
22var_dump( sprintf($format1, $arg1) );
23
24// Calling sprintf() with three arguments
25var_dump( sprintf($format2, $arg1, $arg2) );
26
27// Calling sprintf() with four arguments
28var_dump( sprintf($format3, $arg1, $arg2, $arg3) );
29
30echo "Done";
31?>
32--EXPECT--
33*** Testing sprintf() : basic functionality - using octal format ***
34string(6) "format"
35string(2) "21"
36string(25) "21 1777777777777777777431"
37string(29) "21 1777777777777777777431 567"
38Done
39