Repository navigation
6.0.8
New features:
- Support PHPStan/Psalm-style conditional return types such as
@return ($x is null ? A : B)in@return,@psalm-returnand@phan-return; addPhanCommentReturnConditionalWithoutRealParam(#5574, #5576) - Add
--dump-phase-timingsand--phase-timings-json <path>to report the time and memory of each phase of a run (#5583) - Add the
process_file_assignmentconfig setting to balance files across--processes Nanalysis processes (#5589) - Infer
positive-int,negative-intandnon-zero-intfor arithmetic results when the sign is known (#5577, #5580)
Performance improvements:
- Reduce FQSEN,
TypeandUnionTypeoverhead and skip redundantrealpath()/stat calls and theclonenormalization pass for files withoutclone(#5564, #5586) - Reduce the per-inherited-method cost of the class and method analysis phases (#5587)
- Speed up the parse phase by about 12 % on large projects (#5591)
- Skip emit-only declaration checks of functions and methods declared in excluded files (#5588)
- Skip the
@phan-mandatory-paramand@throwsancestor walks of inherited methods when they cannot find anything (#5590) - Replay the declaration analysis of inherited methods instead of repeating it (#5592)
- Exit
--processes Nanalysis workers without PHP's shutdown sequence to avoid copying shared pages (PHAN_DISABLE_FAST_EXIT=1restores the old behavior) (#5585)
Bug fixes:
- Make the output of
--processes Ndeterministic by combining worker results in worker order (#5584) - Narrow the receiver of a nullsafe access (
$x?->method(),$x?->prop) to non-null in conditions that imply the access succeeded (#5569, #5571) - Keep the real type of constants declared with
define()and inferconstant('NAME')for them (#5542, #5570) - Fix false positives when a branch calls a
never-returning method on a variable assigned withnew ClassName()(#5553, #5554) - Fix crash in
is_callable()narrowing on intersection types (#5555, #5557) - Fix
@var Foo<T>losing its template parameter on properties with a native type declaration (#5556, #5560) - Fix static calls on
class-string<Foo>variables not resolving (#5558, #5561) - Fix false positive
PhanTypeMismatchPropertyDefaultfor promoted property defaults using a class declared later (#5578, #5581) - Fix false positive
PhanImpossibleConditionInGlobalScopewhen a loop in the global scope precedes a function that modifies a global (#5575, #5579) - Fix false positive
PhanParamTooFewInternalforarray_diff(),array_intersect()and related functions called with one array (#5566, #5568) - Fix
array_is_list()being false narrowing arrays tonon-empty-associative-array<array>(#5565, #5567) - Infer the return type of
hrtime()from its$as_numberargument (#5550) - Infer the return type of
substr_replace()from its$stringargument (#5551, #5552) - Fix parameter signatures of
imagecreatefromavif()andimageavif()(#5562, #5563)
Miscellaneous: