Hello,

On Thu, Apr 7, 2011 at 3:03 PM, Rasmus Lerdorf <ras...@lerdorf.com> wrote:
> On 4/7/11 5:59 PM, Matthew Weier O'Phinney wrote:
>>
>> It may change the semantics as they stand, but I'd argue that the
>> _expectation_ from the shorthand ternary is to shorten code that
>> currently uses isset(). As it is, I have almost no use for it at this
>> point, as I end up needing to do:
>>

I don't think that changing it to do a implicit isset really fixes the
reason developers use it as previously mentioned. My code is littered
with isset checks, I would rather see a syntax or operator
specifically for this purpose, like ?? since ?: has already been
implemented in a different (and in my opinion in all to many cases not
a useful) way. Syntax doesn't matter to me though long as it serves my
purpose.

  $var = Array('foo' => 'I am set');
  $value = $var['foo'] ?? 'Foo was not set'; // value = "I am set"
  $value = $var['bar'] ?? 'Bar was not set'; // value ="Bar was not
set"; !!no warning!!

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to