|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-04-06 06:20 UTC] derick@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 03 21:00:01 2025 UTC |
Description: ------------ When you pass an illegal parameter to a function - i.e., a parameter not specified in the function declaration - php should issue a WARNING, or at least a NOTICE, error message. This type of error-checking should be analagous to the WARNING which IS issued when a required parameter is NOT included in a function call. See example below. Reproduce code: --------------- <?php error_reporting(E_ALL | E_STRICT); function foo(){} foo(true); function bar($bar){} bar(); /* OUTPUT: Warning: Missing argument 1 for bar() in /usr/local/apache/htdocs/test/test.php on line 7 EXPECTED OUTPUT: Warning: Illegal argument 1 for foo() in /usr/local/apache/htdocs/test/test.php on line 4 Warning: Missing argument 1 for bar() in /usr/local/apache/htdocs/test/test.php on line 7 */ ?> Expected result: ---------------- Warning: Illegal argument 1 for foo() in /usr/local/apache/htdocs/test/test.php on line 4 Warning: Missing argument 1 for bar() in /usr/local/apache/htdocs/test/test.php on line 7 Actual result: -------------- Warning: Missing argument 1 for bar() in /usr/local/apache/htdocs/test/test.php on line 7