|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2002-06-26 05:38 UTC] rairai82 at dev1 dot rairai82 dot com
[2002-06-26 05:42 UTC] derick@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Wed Jun 17 20:00:01 2026 UTC |
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,