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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Wed Feb 05 06:01:32 2025 UTC