|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #5789 missing arguments
Submitted: 2000-07-26 03:42 UTC Modified: 2000-07-26 07:22 UTC
From: steeven at kali dot com dot cn Assigned:
Status: Closed Package: Other
PHP Version: 4.0.1pl2 OS: win98
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
29 - 19 = ?
Subscribe to this entry?

 [2000-07-26 03:42 UTC] steeven at kali dot com dot cn
here is a short sample program:

function test($a1){
 echo "test";

and an warning is shown:
Warning: Missing argument 1 for test() in e:\apache\htdocs\bbs\test1.php on line 3

There is no problem when I use php4.0.0, anyone have the same problem?



Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2000-07-26 07:22 UTC]
If 4.0.0 didn't complain, then either it was broken or you had your error reporting level set differently.  If you want a function to have an optional argument you have to set a default value.  ie.  function test($a1=0) { ... }
Now you can call just test() without an argument.

PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Sat Jan 28 04:03:49 2023 UTC