2.3.3
Added 2
- Support PHP 8.2 in the Turbo extension
- Infer literal types for word date format characters
Changed 2
- Replace Hoa with a regex parser generated by phplrt
- Update phpdoc-parser, so a PHPDoc is no longer walked to its end for every generic
Fixed 17
- Lexer reads underscore in a tag name in phpdoc-parser
- Printer indents a new tag like the other tags in phpdoc-parser
- Printer puts back asterisks in multi-line texts and descriptions in phpdoc-parser
- Printer keeps Doctrine annotation name and missing parentheses in phpdoc-parser
- Do not let a bootstrap autoloader's exception abort the analysis
- Do not delete a container that another process has not journaled yet
- Ignore the FILTER_THROW_ON_FAILURE bit when the PHP version range only maybe includes PHP 8.5 and the runtime FILTER_FLAG_GLOBAL_RANGE shares it
- Resolve type arguments of generic static types inside the class, in properties and in class constants
- Do not cache isGeneric() or the class PHPDoc while the class name scope is created
- Do not reuse name scopes built from the simplified AST for an analysed file
- An unmatched optional group followed by a matched one is an empty string in preg_match_all() with PREG_SET_ORDER
- MARK in preg_match_all() with PREG_PATTERN_ORDER is an array of marks keyed by match index
- Treat regex assertions as zero-width and groups in negative assertions as never set
- Do not infer preg_match() shapes for duplicate group names outside of separate alternation branches
- A quantified atom that can match the empty string does not make the match non-empty
- Parse backreferences and subroutine calls in regexes, and do not infer shapes for patterns with subroutine calls
- Do not infer preg_match() shapes for branch reset groups outside of the only top level alternation
From PHPStan
Improvements 🔧
- Replace Hoa with a regex parser generated by phplrt (#6851)
- Support PHP 8.2 in the Turbo extension (#6825)
- Update phpdoc-parser (#6854)
- Do not walk to the end of a PHPDoc for every generic (https://github.com/phpstan/phpdoc-parser/pull/326)
- Lexer: read underscore in a tag name (https://github.com/phpstan/phpdoc-parser/pull/330)
- Printer: indent a new tag like the other tags - #329 (https://github.com/phpstan/phpdoc-parser/pull/329)
- Printer: put back asterisks in multi-line texts and descriptions (https://github.com/phpstan/phpdoc-parser/commit/5e32d4864a6babba2ebd31d4a2cc07f0d36d8630)
- Printer: keep Doctrine annotation name and missing parentheses (https://github.com/phpstan/phpdoc-parser/pull/327)
- Infer literal types for word date format characters (#6838), #15537, thanks @westonruter!
Bugfixes 🐛
- Do not let a bootstrap autoloader's exception abort the analysis (#6294), thanks @SanderMuller!
- Do not delete a container that another process has not journaled yet (#6797), thanks @SanderMuller!
- Ignore
FILTER_THROW_ON_FAILUREbit when the PHP version range only maybe includes PHP 8.5 and the runtimeFILTER_FLAG_GLOBAL_RANGEshares it (#6779), #15481, thanks @VincentLanglet and @staabm! - Resolve type arguments of generic static types inside the class, in properties and in class constants (#6826), #15378, #12680
- Do not cache
isGeneric()or the class PHPDoc while the class name scope is created (#6726), #15448, thanks @GErpeldinger! - Do not reuse name scopes built from the simplified AST for an analysed file (#6833), #15475
- Unmatched optional group followed by a matched one is
''inpreg_match_all()withPREG_SET_ORDER(#6851) MARKinpreg_match_all()withPREG_PATTERN_ORDERis an array of marks keyed by match index (#6851)- Treat regex assertions as zero-width and groups in negative assertions as never set (#6851)
- Do not infer
preg_match()shapes for duplicate group names outside of separate alternation branches (#6851) - Quantified atom that can match empty string does not make the match non-empty (#6851)
- Parse backreferences and subroutine calls in regexes, do not infer shapes for patterns with subroutine calls (#6851)
- Do not infer
preg_match()shapes for branch reset groups outside of the only top level alternation (#6851) - Groups in conditional regex subpatterns are optional and conditional subpatterns might match an empty string (#6851)
- Fix PHAR scoping of
trigger_deprecation(), remove stale scoper patchers (#6857) - Keep the expression result alive in the native ReturnHandler (#6852), thanks @SanderMuller!
- Fix global constant discovery after class name tokens (#6756), #15482, thanks @LubuSeb!
- Do not use PHPDoc type of overridable class constants as their native type (#6859)
- Walk catch blocks that no throw point reaches (#6859)
- Walk attribute groups of closures and arrow functions (#6859)
- Use tentative return types of built-in methods as native return types (#6859)
Performance 🏎️
- Keep the restart ini out of the container key (#6834), thanks @SanderMuller!