Re: what happened to that new isset() like language construct
| From: | Marcus Boerger | Date: | Thu, 08 Jul 2004 18:48:11 +0000 |
| Subject: | Re: what happened to that new isset() like language construct | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-10987@lists.php.net to get a copy of this message | ||
Hello Jay,
Thursday, July 8, 2004, 5:31:08 PM, you wrote:
> Marc Richards wrote:
>>
>> Well I'm partial to ?: and there seemed to be some support for it, but
>> there also seemed to be a non-trivial (though not necessarily difficult)
>> amount of work to get it to work right.
>>
>> ifsetor() is obviously less concise, but also the name at first glance
>> is a little non-obvious/confusing. I suppose isset() suffers from the
>> same problem, and people will eventuall get used to it.
>>
>> If the technical problems can be overcome, I'm all for ?: otherwise
>> ifsetor() seemed like the best suggestion so far. I am far less
>> qualified to come up with an alternative than the more experienced
>> PHP'ers out there.
>>
>>
>> Marc
> As far as the name is concerned, I'm kind of partial to coalesce(), as the
> purpose of the function is really similar to the SQL function of the same
> name. This is from the Postgres manual, although I think the function
> itself is from SQL99:
ifsetor is different. It only takes one variable and an optional default
value (any expression).
"ifsetor" "(" <variable> [ "," <expression> ]
")"
Changing it to accept a list of *variables* could probably be possible
but would require heavy restructuring of the compiler. The same is true
for chaning it to accept a variable plus a list of expressions is even
more complicated.
Best regards,
Marcus mailto:helly@php.net