Re: [PHP4BETA] named parameters?
| From: | Boris Erdmann | Date: | Sat, 23 Oct 1999 06:44:17 +0000 |
| Subject: | Re: [PHP4BETA] named parameters? | ||
| References: | 1 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-5653@lists.php.net to get a copy of this message | ||
Andi Gutmans wrote:
>
> At 07:03 PM 10/22/99 +0200, Thies C. Arntzen wrote:
>
> >i'd love to see:
> >
> >funtion test($a=0,$b=0)
> >{
> >}
> >
> >test(b=>"hallo");
> >
> >support in zend - am i dreaming?
>
> We actually thought of doing this quite a long time ago. However, we
> completely changed the argument passing to be much much faster over early
> versions of Zend (it used to be done with a symbol table by name and now
> it's done with a stack by argument number), thus, I don't think we'll be
> seeing this kind of support.
>
Well,
couldnt this be resolved by:
function test($argv) {
;
}
and interpreting
test((foovar=>"fooval", barvar=>"barval"));
as
test(array(foovar=>"fooval", barvar=>"barval")); ?
This would make it even simple to do an argument check
by simply traversing the keys of $argv.
Just asking...
Boris