Re: [PHP-DEV] Re: New operator suggestion

2021-09-04 Thread David Kolář - Micropro Software
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

Re: [PHP-DEV] Re: New Operator

2006-03-15 Thread bertrand Gugger
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

Re: [PHP-DEV] Re: New Operator

2006-03-14 Thread Nico Edtinger
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

Re: [PHP-DEV] Re: New Operator

2006-03-14 Thread Brian Moon
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

Re: [PHP-DEV] Re: New Operator

2006-03-14 Thread Cristiano Duarte
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 >

Re: [PHP-DEV] Re: New Operator

2006-03-14 Thread Brian Moon
$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