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
David Kolář wrote on 9/4/21 17:19:
> Back to the suggestion - I suggest creating a new IFNULL operator, which
> will simply test if
> expression is null. If not, it returns left-hand part, if yes, it
> returns right-hand part.
This is already what the `??` operator does. For example:
https://3v4l.
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
Jason Garber wrote:
> Hello internals,
>
> Since nobody could seem to agree on a language construct for
> accessing a variable that you don't know exists (ifsetor),
> I would like to propose a simpler approach.
>
> It returns the value of the passed variable, or NULL if the variable
>