Bug #17904 Updated: Missing argument for function line number report

From: Date: Wed, 26 Jun 2002 09:38:20 +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-12114@lists.php.net to get a copy of this message
ID: 17904 Updated by: rairai82@dev1.rairai82.com Reported By: david@php.net Status: Open Bug Type: Scripting Engine problem Operating System: Linux PHP Version: 4.2.1 New Comment: Also a problem on php 4.06 on windows. Same exact problem. Definitely not a horrible problem, but annoying =]. Previous Comments: ------------------------------------------------------------------------ [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

« previous php.bugs (#12114) next »