Return to vsprintf_basic6.phpt CVS log | Up to [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / standard / tests / strings |
1.1 misho 1: --TEST-- 2: Test vsprintf() function : basic functionality - exponential format 3: --FILE-- 4: <?php 5: /* Prototype : string vsprintf(string $format , array $args) 6: * Description: Return a formatted string 7: * Source code: ext/standard/formatted_print.c 8: */ 9: 10: echo "*** Testing vsprintf() : basic functionality - using exponential format ***\n"; 11: 12: // Initialise all required variables 13: $format = "format"; 14: $format1 = "%e"; 15: $format2 = "%e %e"; 16: $format3 = "%e %e %e"; 17: $arg1 = array(1000); 18: $arg2 = array(1000,2000); 19: $arg3 = array(1000,2000,3000); 20: 21: var_dump( vsprintf($format1,$arg1) ); 22: var_dump( vsprintf($format2,$arg2) ); 23: var_dump( vsprintf($format3,$arg3) ); 24: 25: echo "Done"; 26: ?> 27: --EXPECTF-- 28: *** Testing vsprintf() : basic functionality - using exponential format *** 29: string(11) "1.000000e+3" 30: string(23) "1.000000e+3 2.000000e+3" 31: string(35) "1.000000e+3 2.000000e+3 3.000000e+3" 32: Done