Re: Re: [RFC] ifsetor operator
| From: | Derick Rethans | Date: | Fri, 16 Apr 2004 19:58:18 +0000 |
| Subject: | Re: Re: [RFC] ifsetor operator | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-9274@lists.php.net to get a copy of this message | ||
On Fri, 16 Apr 2004, Christian Schneider wrote:
> Marcus Boerger wrote:
> > [RFC] ifsetor operator
> >
> > Synopsis: "ifsetor" "(" value "," default ")"
> > Returns the value if it exists or a given default value.
> > Syntax: "ifsetor" "(" variable [ "," expression ]
> > ")"
> > Semantic:
> > - The value in question must be a variable.
>
> I'd prefer to not have this restriction, a return value from a function
> call should be fine. I'd make this any expression.
isset() works on a variable only too, so this behavior matches already
existing behavior.
>
> > - The default value can be any expression.
> > - The default value can be omitted in which case NULL will be used.
>
> I'd also propose to extend this to a whole list of expressions:
no thanks.
> Just brainstorming: An other idea would be an operator like "|||":
> $a = $a1 ||| $a2 ||| $a3;
that looks too perlish. Be happy with what we came up with now.
Derick