Re: [RFC] ifsetor operator
| From: | Marcus Boerger | Date: | Fri, 16 Apr 2004 21:43:12 +0000 |
| Subject: | Re: [RFC] ifsetor operator | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 12 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-9290@lists.php.net to get a copy of this message | ||
Friday, April 16, 2004, 10:36:55 PM, you wrote:
> I vote for nvl(), as the oracle pl/sql function of the same name has
> this exact semantic.
Hello George,
that's avery good idea!
it is to weird to have a lot of people using this already. And a lot of
people would expect the exact behavior by its name. Jus because it exists
elsewhere and there a l ot of people use it.
marcus
> On Apr 16, 2004, at 4:19 PM, Wez Furlong wrote:
>> It's worth nothing that, if T_IFSETOR was recognized by the
>> scanner as "?:", then Sascha/GCC "?:" operator is also implemented
>> by this patch, by changing the parser rule from this:
>>
>> T_IFSETOR '(' variable ',' expr ')'
>>
>> to this:
>>
>> T_IFSETOR variable ':' expr
>>
>> --Wez.
>>
>>
>> ----- Original Message -----
>> From: "Marcus Boerger" <helly@php.net>
>> To: <internals@lists.php.net>
>> Cc: "Jason Garber" <jason@ionzoft.com>; "Andi Gutmans"
>> <andi@zend.com>
>> Sent: Friday, April 16, 2004 8:38 PM
>> Subject: [PHP-DEV] [RFC] ifsetor operator
>>
>>
>>> [RFC] ifsetor operator
>>>
>>> Hello List,
>>>
>>> i also agrre that an internal function is much better. And here is
>>> it as such an internal function (that does not result in an expensive
>>> function call).
>>>
>>> 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.
>>> - The default value can be any expression.
>>> - The default value can be omitted in which case NULL will be used.
>>>
>>>
>>> http://marcus-boerger.de/php/ext/ze2/ze2-ifsetor-20040416-2.diff.txt
>>>
>>> best regards
>>> marcus
>>>
>>>