import zend standard tests
[hiphop-php.git] / hphp / test / zend / good / ext-standard-strings / sprintf_variation36.php
blobe5287ae4aa0fa06f501bb04cb7e148d2b0c45d75
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() : hexa formats with resource values ***\n";
9 // resource type variable
10 $fp = fopen (__FILE__, "r");
11 $dfp = opendir ( dirname(__FILE__) );
13 // array of resource types
14 $resource_values = array (
15 $fp,
16 $dfp
19 // array of hexa formats
20 $hexa_formats = array(
21 "%x", "%xx", "%lx",
22 "%Lx", " %x", "%x ",
23 "\t%x", "\n%x", "%4x",
24 "%30x", "%[0-9A-Fa-f]", "%*x"
27 $count = 1;
28 foreach($resource_values as $resource_value) {
29 echo "\n-- Iteration $count --\n";
31 foreach($hexa_formats as $format) {
32 var_dump( sprintf($format, $resource_value) );
34 $count++;
37 // closing the resources
38 fclose($fp);
39 closedir($dfp);
42 ===DONE===