Return to vprintf_basic2.phpt CVS log | Up to [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / standard / tests / strings |
1.1 misho 1: --TEST-- 2: Test vprintf() function : basic functionality - integer format 3: --FILE-- 4: <?php 5: /* Prototype : string vprintf(string $format , array $args) 6: * Description: Output a formatted string 7: * Source code: ext/standard/formatted_print.c 8: */ 9: 10: /* 11: * Testing vprintf() : basic functionality - using integer format 12: */ 13: 14: echo "*** Testing vprintf() : basic functionality - using integer format ***\n"; 15: 16: // Initialise all required variables 17: $format = "format"; 18: $format1 = "%d"; 19: $format2 = "%d %d"; 20: $format3 = "%d %d %d"; 21: $arg1 = array(111); 22: $arg2 = array(111,222); 23: $arg3 = array(111,222,333); 24: 25: $result = vprintf($format1,$arg1); 26: echo "\n"; 27: var_dump($result); 28: 29: $result = vprintf($format2,$arg2); 30: echo "\n"; 31: var_dump($result); 32: 33: $result = vprintf($format3,$arg3); 34: echo "\n"; 35: var_dump($result); 36: 37: ?> 38: ===DONE=== 39: --EXPECT-- 40: *** Testing vprintf() : basic functionality - using integer format *** 41: 111 42: int(3) 43: 111 222 44: int(7) 45: 111 222 333 46: int(11) 47: ===DONE===