php.net |  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
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: steeven at kali dot com dot cn
New email:
PHP Version: OS:

 

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

<?php
test();
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
test

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

win98+apache+php4.0.1pl2

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-07-26 07:22 UTC] rasmus@php.net
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-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 08:01:27 2024 UTC