[php-src] Issue #7825: Add nullsafe call and index access
| From: | bwoebi | Date: | Fri, 15 Apr 2022 12:01:24 +0000 |
| Subject: | [php-src] Issue #7825: Add nullsafe call and index access | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-240995@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/7825
Comment Author: bwoebi
Regarding 1.: a
?[] operation would at least allow for proper inline short-circuitable
handling. E.g. ($a["does not exist"] ?? null)?["some index"]. I
haven't given it much thought, but there could be in future some unary shortcut operator being
semantically equivalent to array_key_exists($a, $key) ? $a[$key] : null. (Maybe a
postfix !? Could then look like $a["does not exist"]!?["some
index"].)
Regarding 2.: yes.