php.net |  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
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 — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
48 - 1 = ?
Subscribe to this entry?

 
 [2003-06-12 11:04 UTC] php at electricsurfer dot com
Description:
------------
Given:
<?
function myfunc($arg1,$arg2=2,$arg3='',$arg4=false,$arg5=1)
{...}
?>
It would be nice to be able to do this:
<?
myfunc('arg1',5,,true);
?>
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.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-06-12 12:11 UTC] derick@php.net
This was brought up before and it was decided not to do this.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 00:01:29 2024 UTC