Commit 869b3e4
Fix phpstan/phpstan#14394: NAN ==/=== anything is always evaluated as false
- Added containsNan() helper in InitializerExprTypeResolver to recursively
check if a type (including constant arrays) contains NAN
- resolveIdenticalType() and resolveEqualType() now return always-false
when either operand contains NAN
- Updated bug-11054 test expectations: [NAN] === mixed is now correctly
reported as always false (matching PHP runtime behavior)
- New regression test in tests/PHPStan/Rules/Comparison/data/bug-14394.php1 parent 4c6ef6e commit 869b3e4
4 files changed
Lines changed: 80 additions & 0 deletions
File tree
- src/Reflection
- tests/PHPStan/Rules/Comparison
- data
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
| 117 | + | |
117 | 118 | | |
118 | 119 | | |
119 | 120 | | |
| |||
1944 | 1945 | | |
1945 | 1946 | | |
1946 | 1947 | | |
| 1948 | + | |
| 1949 | + | |
| 1950 | + | |
| 1951 | + | |
1947 | 1952 | | |
1948 | 1953 | | |
1949 | 1954 | | |
| |||
1972 | 1977 | | |
1973 | 1978 | | |
1974 | 1979 | | |
| 1980 | + | |
| 1981 | + | |
| 1982 | + | |
| 1983 | + | |
1975 | 1984 | | |
1976 | 1985 | | |
1977 | 1986 | | |
| |||
2061 | 2070 | | |
2062 | 2071 | | |
2063 | 2072 | | |
| 2073 | + | |
| 2074 | + | |
| 2075 | + | |
| 2076 | + | |
| 2077 | + | |
| 2078 | + | |
| 2079 | + | |
| 2080 | + | |
| 2081 | + | |
| 2082 | + | |
| 2083 | + | |
| 2084 | + | |
| 2085 | + | |
| 2086 | + | |
| 2087 | + | |
| 2088 | + | |
| 2089 | + | |
2064 | 2090 | | |
2065 | 2091 | | |
2066 | 2092 | | |
| |||
Lines changed: 15 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
248 | 248 | | |
249 | 249 | | |
250 | 250 | | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
251 | 266 | | |
Lines changed: 26 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1164 | 1164 | | |
1165 | 1165 | | |
1166 | 1166 | | |
| 1167 | + | |
| 1168 | + | |
| 1169 | + | |
| 1170 | + | |
| 1171 | + | |
| 1172 | + | |
| 1173 | + | |
| 1174 | + | |
1167 | 1175 | | |
1168 | 1176 | | |
1169 | 1177 | | |
1170 | 1178 | | |
1171 | 1179 | | |
| 1180 | + | |
| 1181 | + | |
| 1182 | + | |
| 1183 | + | |
| 1184 | + | |
| 1185 | + | |
| 1186 | + | |
| 1187 | + | |
| 1188 | + | |
| 1189 | + | |
| 1190 | + | |
| 1191 | + | |
| 1192 | + | |
| 1193 | + | |
| 1194 | + | |
| 1195 | + | |
| 1196 | + | |
| 1197 | + | |
1172 | 1198 | | |
1173 | 1199 | | |
1174 | 1200 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
0 commit comments