Aug 25 2020, Phan 3.2.0

New features (CLI, Config):

  • Add the minimum_target_php_version config setting and --minimum-target-php-version CLI flag. (#3939) Phan will use this instead of target_php_version for some backwards compatibility checks (i.e. to check that the feature in question is supported by the oldest php version the project supports).

If this is not configured, Phan will attempt to use the composer.json version ranges if they are available. Otherwise, target_php_version will be used.

Phan will use target_php_version instead if minimum_target_php_version is greater than target_php_version.

Update various checks to use minimum_target_php_version instead of target_php_version. + Add --always-exit-successfully-after-analysis flag. By default, phan exits with a non-zero exit code if 1 or more unsuppressed issues were reported. When this CLI flag is set, phan will instead exit with exit code 0 as long as the analysis completed. + Include the installed php-ast version and the php version used to run Phan in the output of phan --version. (#4147)

New features (Analysis):

  • Emit PhanCompatibleArrowFunction if using arrow functions with a minimum target php version older than php 7.4.
  • Emit PhanCompatibleMatchExpression if using match expressions with a minimum target php version older than php 8.0.
  • Emit PhanNoopRepeatedSilenceOperator for @@expr or @(@expr). This is less efficient and only makes a difference in extremely rare edge cases.
  • Avoid false positives for bitwise operations on floats such as unsigned 64-bit numbers (#4106)
  • Incomplete support for analyzing calls with php 8.0's named arguments. (#4037) New issue types: PhanUndeclaredNamedArgument*, PhanDuplicateNamedArgument*, PhanMissingNamedArgument*, PhanDefinitelyDuplicateNamedArgument, PhanPositionalArgumentAfterNamedArgument, and PhanArgumentUnpackingUsedWithNamedArgument, PhanSuspiciousNamedArgumentForVariadic
  • Incomplete support for analyzing uses of PHP 8.0's nullsafe operator(?->) for property reads and method calls. (#4067)
  • Warn about using @var where @param should be used (#1366)
  • Treat undefined variables as definitely null/undefined in various places when they are used outside of loops and the global scope. (#4148)
  • Don't warn about undeclared global constants after defined() conditions. (#3337) Phan will infer a broad range of types for these constants that can't be narrowed.
  • Parse lowercase-string and non-empty-lowercase-string in phpdoc for compatibility, but treat them like ordinary strings.
  • Emit PhanCompatibleTrailingCommaParameterList and PhanCompatibleTrailingCommaArgumentList when the polyfill is used. (#2269) Trailing commas in argument lists require a minimum target version of php 7.3+, and trailing commas in parameters or closure use lists require php 8.0+.

This is only available in the polyfill because the native php-ast parser exposes the information that php itself tracks internally, and php deliberately does not track whether any of these node types have trailing commas.

There are already other ways to detect these backwards compatibility issues, such as --native-syntax-check path/to/php7.x. + Warn about variable definitions that are unused due to fallthroughs in switch statements. (#4162)


  • Add more aliases to DeprecateAliasPlugin


  • Raise the severity of PhanUndeclaredConstant and PhanStaticCallToNonStatic from normal to critical. Undeclared constants will become a thrown Error at runtime in PHP 8.0+.

Bug fixes:

  • Suppress PhanParamNameIndicatingUnused in files loaded from autoload_internal_extension_signatures
  • Improve compatibility of polyfill/fallback parser with php 8.0
  • Also try to check against the realpath() of the current working directory when converting absolute paths to relative paths.
  • Generate baseline files with / instead of \ on Windows in --save-baseline (#4149)

This update has been submitted for testing by remi.

2 years ago

This update's test gating status has been changed to 'ignored'.

2 years ago

This update's test gating status has been changed to 'waiting'.

2 years ago

This update's test gating status has been changed to 'ignored'.

2 years ago

This update has been pushed to testing.

2 years ago

This update can be pushed to stable now if the maintainer wishes

2 years ago

This update has been submitted for stable by bodhi.

2 years ago

This update has been unpushed.

Please login to add feedback.

Content Type
Test Gating
Unstable by Karma
Stable by Karma
Stable by Time
3 days
2 years ago
in testing
2 years ago

Automated Test Results