2 ms·
This is a quibble but reminiscent of the kinds of inconsistency PHP programmers are known for: $value = $object->property ?? 'fallback if null'; $value = $arr
by nkozyra 7y ago
This is a quibble but reminiscent of the kinds of inconsistency PHP programmers are known for:
$value = $object->property ?? 'fallback if null';
$value = $array['foo'] ?? "fallback if key doesn't exists";
- lemcoe9 7y agoI do not understand, both of the expressions on the left-hand side are NULL, which looks like ?? is doing the same thing in both examples. A non-existent array key and a non-existent property on an object are logistically identical.
- nkozyra 7y agoI was referring to the single-versus-double quotes.