import zend standard tests
[hiphop-php.git] / hphp / test / zend / bad / ext-standard-strings / sprintf_variation24.php
blob62ba03fd69ba84851bb29b7b9975369c1ef29333
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() : char formats with array values ***\n";
9 // array of array values
10 $array_values = array(
11 array(),
12 array(0),
13 array(1),
14 array(NULL),
15 array(null),
16 array("string"),
17 array(true),
18 array(TRUE),
19 array(false),
20 array(FALSE),
21 array(1,2,3,4),
22 array(1 => "One", "two" => 2)
25 // array of char formats
26 $char_formats = array(
27 "%c", "%hc", "%lc",
28 "%Lc", " %c", "%c ",
29 "\t%c", "\n%c", "%4c",
30 "%30c", "%[a-bA-B@#$&]", "%*c"
33 $count = 1;
34 foreach($array_values as $array_value) {
35 echo "\n-- Iteration $count --\n";
37 foreach($char_formats as $format) {
38 var_dump( sprintf($format, $array_value) );
40 $count++;
43 echo "Done";