|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #24153 Use default parameters in the middle while overriding def parameters at the end
Submitted: 2003-06-12 11:04 UTC Modified: 2003-06-12 12:11 UTC
From: php at electricsurfer dot com Assigned:
Status: Wont fix Package: Feature/Change Request
PHP Version: 4.3.2 OS: WIN XP
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2003-06-12 11:04 UTC] php at electricsurfer dot com
function myfunc($arg1,$arg2=2,$arg3='',$arg4=false,$arg5=1)
It would be nice to be able to do this:
Which would keep the default values for arguments 3 & 5 but specify a value for argument 4.

This way, if I ever change the default value of $arg3 from '' to null, I have less code to modify.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2003-06-12 12:11 UTC]
This was brought up before and it was decided not to do this.
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sun Dec 05 21:03:39 2021 UTC