Return to vfprintf_error1.phpt CVS log | Up to [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / standard / tests / strings |
1.1 misho 1: --TEST-- 2: Test vfprintf() function : error conditions (more than expected arguments) 3: --CREDITS-- 4: Felix De Vliegher <felix.devliegher@gmail.com> 5: --INI-- 6: precision=14 7: --FILE-- 8: <?php 9: /* Prototype : int vfprintf(resource stream, string format, array args) 10: * Description: Output a formatted string into a stream 11: * Source code: ext/standard/formatted_print.c 12: * Alias to functions: 13: */ 14: 15: // Open handle 16: $file = 'vfprintf_test.txt'; 17: $fp = fopen( $file, "a+" ); 18: 19: echo "\n-- Testing vfprintf() function with more than expected no. of arguments --\n"; 20: $format = 'string_val'; 21: $args = array( 1, 2 ); 22: $extra_arg = 10; 23: var_dump( vfprintf( $fp, $format, $args, $extra_arg ) ); 24: var_dump( vfprintf( $fp, "Foo %d", array(6), "bar" ) ); 25: 26: // Close handle 27: fclose($fp); 28: 29: ?> 30: ===DONE=== 31: --CLEAN-- 32: <?php 33: 34: $file = 'vfprintf_test.txt'; 35: unlink( $file ); 36: 37: ?> 38: --EXPECTF-- 39: -- Testing vfprintf() function with more than expected no. of arguments -- 40: 41: Warning: Wrong parameter count for vfprintf() in %s on line %d 42: NULL 43: 44: Warning: Wrong parameter count for vfprintf() in %s on line %d 45: NULL 46: ===DONE===