Re: Feature?
| From: | Andrey Hristov | Date: | Tue, 25 Sep 2001 11:25:29 +0000 |
| Subject: | Re: Feature? | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-68684@lists.php.net to get a copy of this message | ||
Yeap, I know that. I thought about this bit of hack but this breaks the conception on giving
parameters. Also this trick cannot
solve the problem with default parameters. If I have function with 5 params and all of them have
default values and I want to pass
value only to the second parameter what I have to do?
Andrey Hristov
IcyGEN Corporation
http://www.icygen.com
BALANCED SOLUTIONS
----- Original Message -----
From: <php@alister.dnsalias.com>
To: "Andrey Hristov" <ahristov@icygen.com>
Sent: Tuesday, September 25, 2001 1:14 PM
Subject: Re: [PHP] Feature?
> On Tue, 25 Sep 2001 11:36:25 +0300, you wrote:
>
> >In the case when I've few parameters I've to remember their order, so why not
> >$bar=foo('par2'=>10);
> >I want to pass value to only one or more but not to all params.
> >Also this will make the code clearer I think.
> >Comments are welcome!
>
> <?php
>
> function foo($p)
> {
> echo $p['fred'] . $p['banana'];
> }
>
> foo(array('fred' => 'hello', 'banana' =>
> 'world'));
>
> ?>
>