FEDORA-2019-d3d02b078d created by remi 5 months ago for Fedora 29
pending testing

Aug 18 2019, Phan 2.2.11

New features (Analysis):

  • Add a @phan-real-return annotation for functions/methods/closure (#3099), to make Phan act as if that method has the specified union type when analyzing callers for redundant conditions, etc. (if there was no real type). This can be used for multiple types, e.g. @phan-real-return string|false.
  • Improve union type inferred for clone() - It must be an object if clone() doesn't throw. Emit PhanTypePossiblyInvalidCloneNotObject for cloning possible non-objects when strict param checking is enabled.
  • Infer that new $expr() has a real type of object in all cases, not just common ones.
  • Improve real type inferred for +(expr)/-(expr)/~(expr) and warn about redundant conditions. This does not attempt to account for custom behavior for objects provided by PECL extensions.
  • Show argument names and types in issue messages for functions/methods for PhanParamTooFew and PhanParamTooMany.
  • Show more accurate columns for PhanSyntaxError for unexpected tokens in more cases.
  • Ignore scalar and null type casting config settings when checking for redundant or impossible conditions. (#3105)
  • Infer that empty($x) implies that the value of $x is null, an empty scalar, or the empty array.
  • Avoid false positives with if (empty($x['first']['second'])) - Do not infer any types for the offset 'first' if there weren't any already. (#3112)
  • Avoid some bad inferences when using the value of expressions of the form A || B.
  • Improve redundant condition detection for empty/falsey/truthy checks, self, and internal functions building or processing arrays.
  • Include strings that are suffixes of variable names, classes, methods, properties, etc. in issue suggestions for undeclared elements. (#2342)
  • Emit PhanTypeNonVarReturnByRef when an invalid expression is returned by a function declared to return a reference.
  • Support manually annotating that functions/methods/closures are pure with /** @phan-pure */. This is automatically inherited by overriding methods. Also see UseReturnValuePlugin and 'plugin_config' => ['infer_pure_methods' => true].


  • In UseReturnValuePlugin, support inferring whether closures, functions, and methods are pure when 'plugin_config' => ['infer_pure_methods' => true] is enabled. (they're expected to not have side effects and should have their results used)

This is a best-effort heuristic. This is done only for the functions and methods that are not excluded from analysis, and it isn't done for methods that override or are overridden by other methods.

Note that functions such as fopen() are not pure due to side effects. UseReturnValuePlugin also warns about those because their results should be used.

Automatic inference of function purity is done recursively. + Add EmptyMethodAndFunctionPlugin to warn about functions/methods/closures with empty statement lists. (#3110) This does not warn about functions or methods that are deprecated, overrides, or overridden. + Fix false positive in InvalidVariableIssetPlugin for expressions such as isset(self::$prop['field']) (#3089)


  • Add example vim syntax highlighting snippet for Phan's custom phpdoc annotations to plugins/vim/syntax/phan.vim This makes it easier to tell if annotations were correctly typed.

Bug fixes:

  • Don't scan over folders that would be excluded by 'exclude_file_regex' while parsing. (#3088) That adds additional time and may cause unnecessary permissions errors.
  • Properly parse literal float union types starting with 0.

Aug 12 2019, Phan 2.2.10

New features(Analysis):

  • Add support for @param MyClass &$x @phan-ignore-reference, to make Phan ignore the impact of references on the passed in argument. (#3082) This can be used when the result should be treated exactly like the original type for static analysis.


  • In EmptyStatementListPlugin, warn about switch statements where all cases are no-ops. (#3030)

Bug fixes:

  • Fix infinite recursion seen when passing void to something expecting a non-null type. (#3085) This only occurs with some settings, e.g. when null_casts_as_any_type is true. (introduced in 2.2.9)

Aug 11 2019, Phan 2.2.9

New features (Analysis):

  • Emit the stricter issue type PhanTypeMismatchReturnReal instead of PhanTypeMismatchReturn when Phan infers that the real type of the returned expression is likely to cause a TypeError (accounting for strict_types in the file). (#403) See internal/Issue-Types-Caught-by-Phan.md for details on when it is thrown.
  • Emit the stricter issue type PhanTypeMismatchArgumentReal instead of PhanTypeMismatchArgument when Phan infers that the real type of the argument is likely to cause a TypeError at runtime (#403)
  • Support php 7.4 typed property groups in the polyfill/fallback parser.
  • Warn about passing properties with incompatible types to reference parameters (#3060) New issue types: PhanTypeMismatchArgumentPropertyReference, PhanTypeMismatchArgumentPropertyReferenceReal
  • Detect redundant conditions such as is_array($this->array_prop) on typed properties. Their values will either be a value of the correct type, or unset. (Reading from unset properties will throw an Error at runtime)
  • Emit PhanCompatibleTypedProperty if the target php version is less than 7.4 but typed properties are used.
  • Emit PhanTypeMismatchPropertyReal instead of PhanTypeMismatchProperty if the properties have real types that are incompatible with the inferred type of the assignment.
  • Stop warning about (float) $int being redundant - there are small differences in how ints and floats are treated by serialize, var_export, is_int, etc.
  • Treat all assignments to $this->prop in a scope the same way (for real, dynamic, and magic properties) Previously, Phan would not track the effects of some assignments to dynamic properties.
  • Make unset($this->prop) make Phan infer that the property is unset in the current scope (and treat it like null) (only affects $this). (#3025) Emit PhanPossiblyUnsetPropertyOfThis if the property is read from without setting it.
  • Don't emit PhanTypeArraySuspiciousNull when array access is used with the null coalescing operator. (#3032)
  • Don't emit PhanTypeInvalidDimOffset when array access is used with the null coalescing operator. (#2123)
  • Make Phan check for PhanUndeclaredTypeProperty suppressions on the property's doc comment, not the class. (#3047)
  • Make inferred real/phpdoc types for results of division more accurate.
  • Improve analysis of for loops and while loops. Account for the possibility of the loop iteration never occurring. (unless the condition is unconditionally true)
  • Fix some edge cases that can cause PhanTypeMismatchProperty (#3067, #1867) If there was a phpdoc or real type, check against that instead when emitting issues.
  • Analyze assignments to fields of properties of $this (e.g. $this->prop[] = 'value';) for correctness and for the new type combination. (#3059)
  • Infer that the void should be treated similarly to null (in addition to existing checks, it's redundant to compare them to null). Don't warn about return null; in functions/methods with phpdoc-only @return void.


  • Add StrictComparisonPlugin, which warns about the following issue types:

  • Using in_array or array_search without specifying $strict. (PhanPluginComparisonNotStrictInCall)

  • Using comparison or weak equality operators when both sides are possibly objects. (PhanPluginComparisonObjectEqualityNotStrict, PhanPluginComparisonObjectOrdering)
  • Don't warn in EmptyStatementListPlugin if a TODO/FIXME/"Deliberately empty" comment is seen around the empty statement list. (#3036) (This may miss some TODOs due to php-ast not providing the end line numbers) The setting 'plugin_config' => ['empty_statement_list_ignore_todos' => true] can be used to make it unconditionally warn about empty statement lists.
  • Improve checks for UseReturnValuePlugin for functions where warning depend on their arg count (call_user_func, trait/interface/class_exists, preg_match, etc)

Bug fixes:

  • When a typed property has an incompatible default, don't infer the union type from the default. (#3024)
  • Don't emit PhanTypeMismatchProperties for assignments to dynamic properties. (#3042)
  • Fix false positive RedundantConditions analyzing properties of $this in the local scope. (#3038)
  • Properly infer that real type is always int (or a subtype) after the is_int($var) condition.
  • Emit TypeMismatchUnpack* for nullable key types of iterables if the union type didn't contain any int/mixed types. (fix logic error)

Jul 30 2019, Phan 2.2.8

New features (CLI):

  • Add heuristics to tool/phoogle to better handle object, and to include functions with nullable params in the results of searches for all functions. (#3014)

New features (Analysis):

  • Emit PhanCompatibleImplodeOrder when the glue string is passed as the second instead of the first argument (#2089)
  • Emit PhanCompatibleDimAlternativeSyntax when using array and string array access syntax with curly braces when using the polyfill parser or php 7.4+. (#2989)
  • Emit PhanCompatibleUnparenthesizedTernary for expressions such as a ? b : c ? d : e. (#2989) (when using the polyfill parser or php 7.4+)
  • Emit PhanConstructAccessSignatureMismatch when a constructor is less visible than the parent class's constructor and the target php version is 7.1 or older. (#1405)


  • Make EmptyStatementListPlugin check if statements with negated conditions (those were previously skipped because they were simplified).

Bug fixes:

  • Fix a crash analyzing a dynamic property by reference (introduced in 2.2.7) (#3020)

Jul 27 2019, Phan 2.2.7

New features (CLI, Configs):

  • Include columns with most (but not all) occurrences of PhanSyntaxError (inferred using the polyfill - these may be incorrect a small fraction of the time)

When the error is from the native php-ast parser, this is a best guess at the column.

hide_issue_column can be used to remove the column from issue messages. + Add --absolute-path-issue-messages to emit absolute paths instead of relative paths for the file of an issue. (#1640) Note that this does not affect files within the issue message. + Properly render the progress bar when Phan runs with multiple processes (#2928) + Add an HTML output mode to generate an unstyled HTML fragment. Example CSS styles can be generated with internal/dump_html_styles.php + Add a light color scheme for white backgrounds.

New features (Analysis):

  • Fix failure to infer real types when an invoked function or method had a phpdoc @return in addition to the real type.
  • Infer union type from all classes that an instance method could possibly be, not just the first type seen in the expression's union type. (#2988)
  • Preserve remaining real union types after negation of instanceof checks (e.g. to check for redundant conditions).
  • Warn about throwing from __toString() in php versions prior to php 7.4. (#2805)
  • Emit PhanTypeArraySuspiciousNull for code such as null['foo'] (#2965)
  • If a property with no phpdoc type has a default of an empty array, assume that it's type can be any array (when reading it) until the first assignment is seen.
  • Attempt to analyze modifying dynamic properties by reference (e.g. $var->$prop when $prop is a variable with a known string)
  • For undeclared variables in the global scope, emit PhanUndeclaredGlobalVariable instead of PhanUndeclaredVariable to distinguish those from undeclared variables within functions/methods. (#1652)
  • Emit PhanCompatibleSyntaxNotice for notices such as the deprecated (real) cast in php 7.4, when the real parser is used (#3012)

Language Server/Daemon mode:

  • When PhanSyntaxError is emitted, make the start of the error range the column of the error instead of the start of the line.


  • Add EmptyStatementListPlugin to warn about empty statement lists involving if/elseif statements, try statements, and loops.
  • Properly warn about redundant @return annotations followed by other annotation lines in PHPDocRedundantPlugin.

Bug fixes:

  • Treat Foo::class as a reference to the class/interface/trait Foo (#2945)
  • Fix crash for (real) cast in php 7.4. (#3012)
  • Work around crash due to deprecation notices in composer dependencies in php 7.4

This update has been submitted for testing by remi.

5 months ago

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

5 months ago

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

5 months ago

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

5 months ago

Please login to add feedback.

Content Type
Test Gating
Unstable by Karma
Stable by Karma
Stable by Time
7 days
5 months ago

Automated Test Results