#23439 [Opn->WFx]: Allow default values to be passed for functions

From: Date: Thu, 01 May 2003 14:45:53 +0000
Subject: #23439 [Opn->WFx]: Allow default values to be passed for functions
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-38885@lists.php.net to get a copy of this message
ID: 23439 Updated by: derick@php.net Reported By: steveh at brendata dot co dot uk -Status: Open +Status: Wont fix Bug Type: Feature/Change Request Operating System: linux 2.4.20 PHP Version: 4.3.1 New Comment: This was submitted before and respectfully declined. If you want to use something like this, you can either use an array based approach or use func_get_args(). Derick Previous Comments: ------------------------------------------------------------------------ [2003-05-01 09:38:54] steveh at brendata dot co dot uk It would be useful to be able to omit function arguments and have the function still use the defaults even though some to the right were passed: e.g. function fred ($a,$b=1,$c=2,$d=3) { echo "a=$a,b=$b,c=$c,d=$d"; } fred(-1); fred(-1,,4,5); ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=23439&edit=1

« previous php.bugs (#38885) next »