Commit 22f51ec
committed
Fix execution branch confusion with multiple variable assignments in if/else
- Changed createConditionalExpressions to create pairwise conditional holders instead of one holder with all guards
- In a binary branch merge, any single type guard uniquely identifies the branch, so individual guards are sufficient
- Previously, 3+ type guards created holders requiring all-minus-one conditions, causing circular dependency in resolution
- New regression test in tests/PHPStan/Analyser/nsrt/bug-5051.php
Closes phpstan/phpstan#50511 parent d462113 commit 22f51ec
File tree
2 files changed
+77
-4
lines changed- src/Analyser
- tests/PHPStan/Analyser/nsrt
2 files changed
+77
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4141 | 4141 | | |
4142 | 4142 | | |
4143 | 4143 | | |
4144 | | - | |
4145 | | - | |
| 4144 | + | |
| 4145 | + | |
| 4146 | + | |
| 4147 | + | |
4146 | 4148 | | |
4147 | 4149 | | |
4148 | 4150 | | |
4149 | 4151 | | |
4150 | 4152 | | |
4151 | 4153 | | |
4152 | 4154 | | |
4153 | | - | |
4154 | | - | |
| 4155 | + | |
| 4156 | + | |
| 4157 | + | |
| 4158 | + | |
4155 | 4159 | | |
4156 | 4160 | | |
4157 | 4161 | | |
| |||
| 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 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
0 commit comments