Annotation of embedaddon/php/ext/standard/tests/strings/vsprintf_basic3.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: Test vsprintf() function : basic functionality - float 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 float format ***\n";
                     11: 
                     12: // Initialise all required variables
                     13: 
                     14: $format = "format";
                     15: $format1 = "%f";
                     16: $format2 = "%f %f";
                     17: $format3 = "%f %f %f";
                     18: 
                     19: $format11 = "%F";
                     20: $format22 = "%F %F";
                     21: $format33 = "%F %F %F";
                     22: $arg1 = array(11.11);
                     23: $arg2 = array(11.11,22.22);
                     24: $arg3 = array(11.11,22.22,33.33);
                     25: 
                     26: var_dump( vsprintf($format1,$arg1) );
                     27: var_dump( vsprintf($format11,$arg1) );
                     28: 
                     29: var_dump( vsprintf($format2,$arg2) );
                     30: var_dump( vsprintf($format22,$arg2) );
                     31: 
                     32: var_dump( vsprintf($format3,$arg3) );
                     33: var_dump( vsprintf($format33,$arg3) );
                     34: 
                     35: echo "Done";
                     36: ?>
                     37: --EXPECTF--
                     38: *** Testing vsprintf() : basic functionality - using float format ***
                     39: string(9) "11.110000"
                     40: string(9) "11.110000"
                     41: string(19) "11.110000 22.220000"
                     42: string(19) "11.110000 22.220000"
                     43: string(29) "11.110000 22.220000 33.330000"
                     44: string(29) "11.110000 22.220000 33.330000"
                     45: Done

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>