packagist phan/phan 2.2.1
Release 2.2.1 supporting PHP 7.0-7.3 syntax

latest releases: v5.x-dev, dev-fix-4782, dev-MapReal-php81-82...
4 years ago

New features(CLI, Configs):

  • When printing help messages for errors in phan --init, print only the related options.
  • Make phan --init enable redundant_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 and PhanImpossibleCondition for $x instanceof SomeClass expressions.
  • Emit PhanImpossibleCondition for is_array and is_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.

Don't miss a new phan release

NewReleases is sending notifications on new releases.