Commit 36db1ff
Mark mysqli_connect as having side effects in function metadata
mysqli_connect establishes a network connection to a database server,
which is inherently a side effect. Marking it as hasSideEffects => true
causes TypeSpecifier to return empty SpecifiedTypes for the call, which
prevents stale conditional expressions from being created and fixes the
false positive logicalOr.leftAlwaysTrue on repeated calls.
Fixes phpstan/phpstan#14473
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent 55c63e4 commit 36db1ff
2 files changed
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
| 97 | + | |
97 | 98 | | |
98 | 99 | | |
99 | 100 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1392 | 1392 | | |
1393 | 1393 | | |
1394 | 1394 | | |
| 1395 | + | |
1395 | 1396 | | |
1396 | 1397 | | |
1397 | 1398 | | |
| |||
0 commit comments