We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0b419bb commit 7b6e90fCopy full SHA for 7b6e90f
ppcs/ppc0021-optional-chaining-operator.md
@@ -100,6 +100,25 @@ is equivalent to:
100
101
with the important caveat that EXPR1 is only evaluated once.
102
103
+When used in a longer chain of dereferences, an undef value will short-circuit the entire
104
+chain, rather than just a single expression:
105
+
106
+ EXPR1 ?-> EXPR2 ?-> EXPR3
107
108
+is equivalent to:
109
110
+```perl
111
+ if (defined EXPR1) {
112
+ if (defined EXPR1->EXPR2) {
113
+ return EXPR1->EXPR2->EXPR3
114
+ } else {
115
+ return ()
116
+ }
117
118
+ return () # empty list
119
120
+```
121
122
## Backwards Compatibility
123
124
All code with `?->` currently yields a compile time syntax error, so there
0 commit comments