#36991 [Opn->Bgs]: Passing illegal parameter to function should generate WARNING
| From: | derick@php.net | Date: | Thu, 06 Apr 2006 06:20:07 +0000 |
| Subject: | #36991 [Opn->Bgs]: Passing illegal parameter to function should generate WARNING | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-95376@lists.php.net to get a copy of this message | ||
ID: 36991
Updated by: derick@php.net
Reported By: gk at proliberty dot com
-Status: Open
+Status: Bogus
Bug Type: Feature/Change Request
Operating System: Red Hat Linux 9
PHP Version: 5.1.2
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
This is there so that you can use func_get_args() and friends.
Previous Comments:
------------------------------------------------------------------------
[2006-04-06 00:08:53] gk at proliberty dot com
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
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=36991&edit=1