Phan is a static analyzer for PHP. Phan prefers to avoid false-positives and attempts to prove incorrectness rather than correctness.
getIterator
returning an ordinary Iterator<X>
(previously only inferred types for subclasses of Iterator)[...$x]
in an issue message (#4351)if ($x)
converts non-null-mixed
to non-empty-mixed
self::CONST_NAME
from inside of a subclass of the constant's declaring class (#4360)allow_method_param_type_widening
from minimum_target_php_version
to avoid false positive PhanParamSignatureRealMismatchHasNoParamType
.PhanUndeclaredThis
inside of static methods/closures (#4336)::
and ->
at the end of a line on files using Windows line endings(\r\n
) instead of Unix newlines(\n
) on any OS (#4345)
Previously, those were not completed.PhanParamSignatureMismatch
for variadic overriding a function using func_get_args()
(#4340)function(paramtypes):returntype
(#4343)New Features:
PhanCompatibleAssertDeclaration
when declaring a function called assert
. (#4333)Bug fixes:
PhanInvalidConstantExpression
for named arguments in attributes (#4334)Merge changes from Phan 3.2.10
Phan 4 is out (requires php-ast 1.0.7+ or the polyfill to run, and uses AST version 80). That release line will contain all of Phan's new features, bug fixes, and crash fixes.
The Phan 3.x release line uses php-ast
's AST version 70 and supports the analysis of all PHP 8.0 syntax except attributes (when run with PHP 8).
STDERR
. (#4189)--help
, --version
, and crash reports. (#4189)
The environment variable PHAN_SUPPRESS_PHP_UPGRADE_NOTICE=1
can be set to disable this notice.The Phan v4 release line has the following changes from Phan 3:
#[...]
attributes are used properly when run with PHP 8.0+The Phan 3.x release line uses php-ast
's AST version 70 and supports the analysis of all PHP 8.0 syntax except attributes (when run with PHP 8).
The planned 4.x release line will use AST version 80 and require php-ast
1.0.10+ in order to parse/analyze PHP 8.0's #[]
attributes
Bug fixes:
SomeClassWithoutConstruct::__construct
in some edge cases. (#4323)self
is referring to the current object context even when the object context is unknown in namespaces. (#4070)Deprecations:
PHAN_SUPPRESS_AST_DEPRECATION=1
.The Phan v4 release line has the following changes from Phan 3:
#[...]
attributes are used properly when run with PHP 8.0+Merge changes from Phan 3.2.8
The Phan 3.x release line uses php-ast
's AST version 70 and supports the analysis of all PHP 8.0 syntax except attributes (when run with PHP 8).
The planned 4.x release line will use AST version 80 and require php-ast
1.0.10+ in order to parse/analyze PHP 8.0's #[]
attributes
-z
/--signature-compatibility
- that option now enables analyze_signature_compatibility
instead of disabling it. (#4303)PhanCoalescingNeverUndefined
for variable defined in catch block (#4305)PhanCompatibleConstructorPropertyPromotion
when minimum_target_php_version
is 8.0 or newer. (#4307)The Phan v4 release line has the following changes from Phan 3:
#[...]
attributes are used properly when run with PHP 8.0+Merge changes from Phan 3.2.7
The Phan 3.x release line uses php-ast
's AST version 70 and supports the analysis of all PHP 8.0 syntax except attributes (when run with PHP 8).
The planned 4.x release line will use AST version 80 and require php-ast
1.0.10+ in order to parse/analyze PHP 8.0's #[]
attributes
fscanf
/scanf
/mb_convert_variables
PhanSuspiciousNamedArgumentVariadicInternal
when using named arguments with variadic parameters of internal functions that are
not among the few reflection functions known to support named arguments. (#4284)non-null-mixed
type and change the way analysis involving nullability is checked for mixed
(phpdoc and real). (#4278, #4276)