Bug #17904 Updated: Missing argument for function line number report
| From: | derick@php.net | Date: | Wed, 26 Jun 2002 09:42:43 +0000 |
| Subject: | Bug #17904 Updated: Missing argument for function line number report | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-12115@lists.php.net to get a copy of this message | ||
ID: 17904
Updated by: derick@php.net
Reported By: david@php.net
-Status: Open
+Status: Bogus
Bug Type: Scripting Engine problem
Operating System: Linux
PHP Version: 4.2.1
New Comment:
Not really a bug, but expected behavior. Anyway, you can use
xdebug.derickrethans.nl to get even more debug information, or wait for
ZE2.
Derick
Previous Comments:
------------------------------------------------------------------------
[2002-06-26 05:38:20] rairai82@dev1.rairai82.com
Also a problem on php 4.06 on windows. Same exact problem. Definitely
not a horrible problem, but annoying =].
------------------------------------------------------------------------
[2002-06-21 12:44:19] david@php.net
The warning "Missing argument X for function()" is reported on the line
the function is defined, not the line calling the function. Since a
missing argument is an error in the caller, not the callee, the error
should be reported at the caller's line number.
Reproducing script:
<?
function NormalFunction($var1, $var2) {
echo "Normalfunction called with $var1, $var2\n";
}
class ABC {
function ABC($var1, $var2) {
echo "I was constructed with $var1, $var2\n";
}
function Test($var1, $var2) {
echo "My test function was called with $var1, $var2\n";
}
}
NormalFunction(3);
$myobj = new ABC(4);
$myobj->Test(5);
?>
<br>
<b>Warning</b>: Missing argument 2 for normalfunction()
in <b>/home/david/missingarg.php</b> on line <b>3</b><br>
Normalfunction called with 3,
<br>
<b>Warning</b>: Missing argument 2 for abc()
in <b>/home/david/missingarg.php</b> on line <b>8</b><br>
I was constructed with 4,
<br>
<b>Warning</b>: Missing argument 2 for test()
in <b>/home/david/missingarg.php</b> on line <b>12</b><br>
My test function was called with 5,
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=17904&edit=1