1--TEST-- 2Test parse_url() function : error conditions - wrong number of args 3--FILE-- 4<?php 5/* Prototype : proto mixed parse_url(string url, [int url_component]) 6 * Description: Parse a URL and return its components 7 * Source code: ext/standard/url.c 8 * Alias to functions: 9 */ 10 11echo "*** Testing parse_url() : error conditions ***\n"; 12 13// Zero arguments 14echo "\n-- Testing parse_url() function with Zero arguments --\n"; 15var_dump( parse_url() ); 16 17//Test parse_url with one more than the expected number of arguments 18echo "\n-- Testing parse_url() function with more than expected no. of arguments --\n"; 19$url = 'string_val'; 20$url_component = 10; 21$extra_arg = 10; 22var_dump( parse_url($url, $url_component, $extra_arg) ); 23 24echo "Done"; 25?> 26--EXPECTF-- 27*** Testing parse_url() : error conditions *** 28 29-- Testing parse_url() function with Zero arguments -- 30 31Warning: parse_url() expects at least 1 parameter, 0 given in %s on line 12 32NULL 33 34-- Testing parse_url() function with more than expected no. of arguments -- 35 36Warning: parse_url() expects at most 2 parameters, 3 given in %s on line 19 37NULL 38Done