Well, yes, but not exactly.
What I dislike on ?? operator is, that it supress all warnings in the
expression - in my opinion it shares the same
issue as @ operator and why people discourage other to use it - because
it may supress far more errors than you want
to supress. And this is the case w
Brian Moon wrote:
Oh, you want an operator to do that? Does some other language have this
that we are wanting to copy here? Seems overly complicated to me. But,
so does a lot of things being added PHP these days.
As bash ${parameter:=word} ?
--
toggg
--
PHP Internals - PHP Runtime Develop
Brian Moon wrote:
Oh, you want an operator to do that? Does some other language have
this that we are wanting to copy here?
IIRC C# 3.0 adds a new operator ?: written as "foo = bar ?: 'default
value';". I tried to search a resource with some documentation about
this new operator, but Goog
But you still don't have a default value, just an empty default
value(string, zero, etc.). You can't i.e. initialize $_GET["ConfirmCode"]
with "Yes" using settype...
Oh, you want an operator to do that? Does some other language have this
that we are wanting to copy here? Seems overly complica
Brian Moon wrote:
>>> $ConfirmCode = (isset($_GET['ConfirmCode']) ? $_GET['ConfirmCode'] :
>>> '');
>> I agree that this is really a PITA, but until we get an operator for
>> this, we should stuck on the ternary.
>
>
> Another option is to use settype(); This has two advantages. One, if
>
$ConfirmCode = (isset($_GET['ConfirmCode']) ? $_GET['ConfirmCode'] :
'');
I agree that this is really a PITA, but until we get an operator for this,
we should stuck on the ternary.
Another option is to use settype(); This has two advantages. One, if
the variable does not exist, settype