Commit 1057cce
committed
Always memoize calls in lhs of coalesce assignment
We don't want to invoke calls twice, even if they are considered "variables",
i.e. might be writable if returning a reference. Function calls behave the same
in all BP contexts so they don't need to be invoked twice. The singular
exception to this is nullsafe coalesce in isset/empty, because it needs to
return false/true respectively when short-circuited. However, since nullsafe
calls are not allwed in write context we may ignore this problem.
Closes GH-115921 parent c0ce3e7 commit 1057cce
2 files changed
+77
-16
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4589 | 4589 | | |
4590 | 4590 | | |
4591 | 4591 | | |
4592 | | - | |
4593 | | - | |
4594 | | - | |
4595 | | - | |
4596 | | - | |
4597 | | - | |
4598 | | - | |
4599 | | - | |
| 4592 | + | |
4600 | 4593 | | |
4601 | 4594 | | |
4602 | 4595 | | |
| |||
4615 | 4608 | | |
4616 | 4609 | | |
4617 | 4610 | | |
4618 | | - | |
4619 | | - | |
4620 | | - | |
4621 | | - | |
4622 | | - | |
4623 | | - | |
4624 | | - | |
4625 | | - | |
| 4611 | + | |
4626 | 4612 | | |
4627 | 4613 | | |
4628 | 4614 | | |
| |||
10591 | 10577 | | |
10592 | 10578 | | |
10593 | 10579 | | |
| 10580 | + | |
| 10581 | + | |
| 10582 | + | |
| 10583 | + | |
| 10584 | + | |
| 10585 | + | |
| 10586 | + | |
| 10587 | + | |
| 10588 | + | |
| 10589 | + | |
| 10590 | + | |
10594 | 10591 | | |
10595 | 10592 | | |
10596 | 10593 | | |
| |||
0 commit comments