New features(CLI, Configs):
- When printing help messages for errors in
phan --init
, print only the related options. - Make
phan --init
enableredundant_condition_detection
when the strictest init level is requested. (#2849) - Add
--assume-real-types-for-internal-functions
to make stricter assumptions about the real types of internal functions (for use with--redundant-condition-detection
).
Note that in PHP 7 and earlier, internal functions would return null/false for incorrect argument types/argument counts, so enabling this option may cause false positives.
New features(Analysis):
- Reduce the number of false positives of
--redundant-condition-detection
for variables in loops - Warn about more types of expressions causing redundant conditions (#2534, #822).
- Emit
PhanRedundantCondition
andPhanImpossibleCondition
for$x instanceof SomeClass
expressions. - Emit
PhanImpossibleCondition
foris_array
andis_object
checks.
Bug fixes:
- Fix issue that would make Phan infer that a redundant/impossible condition outside a loop was in a loop.
- Avoid false positives analyzing expressions within
assert()
. - Fix method signatures for php 7.4's
WeakReference
. - Fix false positives analyzing uses of
__call
and__callStatic
(#702) - Fix false positive redundant conditions for casting
callable
to object types.