packagist phan/phan 2.0.0-RC2
Release 2.0.0-RC2 supporting PHP 7.0-7.3 syntax

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

The Phan 2.x releases support analysis of php 7.0-7.3, and can be executed with php 7.1+.

New features(Analysis):

  • Support analysis of PHP 7.4's short arrow function syntax (fn ($arg) => expr) (#2714)
    (requires php-ast 1.0.2dev or newer)

    Note that the polyfill does not yet support this syntax.

  • Infer the return types of PHP 7.4's magic methods __serialize() and __unserialize(). (#2755)
    Improve analysis of return types of other magic methods such as __sleep().

  • Support more of PHP 7.4's function signatures (e.g. WeakReference) (#2756)

  • Improve detection of unused variables inside of loops/branches.

Plugins:

  • Detect some new php 7.3 functions (array_key_first, etc.) in UseReturnValuePlugin.
  • Don't emit a PhanNativePHPSyntaxCheckPlugin error in InvokePHPNativeSyntaxCheckPlugin due to a shebang before declare(strict_types=1)
  • Fix edge cases running PhanNativePHPSyntaxCheckPlugin on Windows (in language server/daemon mode)

Bug fixes:

  • Analyze the remaining expressions in a statement after emitting PhanTraitParentReference (#2750)
  • Don't emit PhanUndeclaredVariable within a closure if a use variable was undefined outside of it. (#2716)

Don't miss a new phan release

NewReleases is sending notifications on new releases.