Skip to content

Conversation

@staabm
Copy link
Contributor

@staabm staabm commented Jan 17, 2026

micro optimization in a very hot path

if (
$a instanceof ConstantStringType
) {
$description = $b->describe(VerbosityLevel::value());
Copy link
Contributor Author

@staabm staabm Jan 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

describe $b only when $a == ''.

before we described $b no matter which constant-value $a had

@ondrejmirtes ondrejmirtes merged commit 26e57f0 into phpstan:2.1.x Jan 17, 2026
623 of 645 checks passed
@ondrejmirtes
Copy link
Member

Thank you!

@staabm staabm deleted the tc branch January 17, 2026 08:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants