import zend standard tests
[hiphop-php.git] / hphp / test / zend / good / ext-standard-strings / sprintf_basic8_64bit.php
blobf3a43956d524f1a79905e025dee5ae5e5174a90a
1 <?php
2 /* Prototype : string sprintf(string $format [, mixed $arg1 [, mixed ...]])
3 * Description: Return a formatted string
4 * Source code: ext/standard/formatted_print.c
5 */
7 echo "*** Testing sprintf() : basic functionality - using octal format ***\n";
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 = 05678;
18 // Calling sprintf() with default arguments
19 var_dump( sprintf($format) );
21 // Calling sprintf() with two arguments
22 var_dump( sprintf($format1, $arg1) );
24 // Calling sprintf() with three arguments
25 var_dump( sprintf($format2, $arg1, $arg2) );
27 // Calling sprintf() with four arguments
28 var_dump( sprintf($format3, $arg1, $arg2, $arg3) );
30 echo "Done";