1--TEST-- 2Test parse_ini_file() function : error conditions 3--FILE-- 4<?php 5/* Prototype : proto array parse_ini_file(string filename [, bool process_sections]) 6 * Description: Parse configuration file 7 * Source code: ext/standard/basic_functions.c 8 * Alias to functions: 9 */ 10 11echo "*** Testing parse_ini_file() : error conditions ***\n"; 12 13// Zero arguments 14echo "\n-- Testing parse_ini_file() function with Zero arguments --\n"; 15var_dump( parse_ini_file() ); 16 17//Test parse_ini_file with one more than the expected number of arguments 18echo "\n-- Testing parse_ini_file() function with more than expected no. of arguments --\n"; 19$filename = 'string_val'; 20$process_sections = true; 21$extra_arg = 10; 22var_dump( parse_ini_file($filename, $process_sections, $extra_arg) ); 23 24echo "\n-- Testing parse_ini_file() function with a non-existent file --\n"; 25$filename = __FILE__ . 'invalidfilename'; 26var_dump( parse_ini_file($filename, $process_sections) ); 27 28echo "Done"; 29?> 30--EXPECTF-- 31*** Testing parse_ini_file() : error conditions *** 32 33-- Testing parse_ini_file() function with Zero arguments -- 34 35Warning: parse_ini_file() expects at least 1 parameter, 0 given in %s on line %d 36bool(false) 37 38-- Testing parse_ini_file() function with more than expected no. of arguments -- 39 40Warning: parse_ini_file(%s): failed to open stream: No such file or directory in %s on line %d 41bool(false) 42 43-- Testing parse_ini_file() function with a non-existent file -- 44 45Warning: parse_ini_file(%s): failed to open stream: No such file or directory in %s on line %d 46bool(false) 47Done 48