import zend standard tests
[hiphop-php.git] / hphp / test / zend / good / ext-standard-strings / printf_basic5.php
blobe49762f57473486bc08ba3b7ccbe1ba012fd9ecf
1 <?php
2 /* Prototype : int printf ( string $format [, mixed $args [, mixed $... ]] )
3 * Description: Produces output according to format .
4 * Source code: ext/standard/formatted_print.c
5 */
7 echo "*** Testing printf() : basic functionality - using char format ***\n";
10 // Initialise all required variables
11 $format = "format";
12 $format1 = "%c";
13 $format2 = "%c %c";
14 $format3 = "%c %c %c";
15 $arg1 = 65;
16 $arg2 = 66;
17 $arg3 = 67;
19 echo "\n-- Calling printf() with no arguments --\n";
20 $result = printf($format);
21 echo "\n";
22 var_dump($result);
24 echo "\n-- Calling printf() with one arguments --\n";
25 $result = printf($format1, $arg1);
26 echo "\n";
27 var_dump($result);
29 echo "\n-- Calling printf() with two arguments --\n";
30 $result = printf($format2, $arg1, $arg2);
31 echo "\n";
32 var_dump($result);
34 echo "\n-- Calling printf() with three arguments --\n";
35 $result = printf($format3, $arg1, $arg2, $arg3);
36 echo "\n";
37 var_dump($result);
39 ===DONE===