Skip to content

Conversation

@staabm
Copy link
Contributor

@staabm staabm commented Dec 19, 2025

No description provided.

@staabm staabm marked this pull request as ready for review December 19, 2025 17:55
@phpstan-bot
Copy link
Collaborator

This pull request has been marked as ready for review.

unset($otherVariableTypeHolders[$variableExprString]);
}

if (count($otherVariableTypeHolders) > 0) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

in the loop this array is reduced one offset at a time, which only makes sense if we check afterwards whether $otherVariableTypeHolders contained elements which were not contained in $variableTypeHolders

Copy link
Member

Choose a reason for hiding this comment

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

Can you write a failing test against this? Or is it just about performance?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah, I think I need to come up with a test. looks like a bug to me.

not perf related, just stumbled over it, while looking into #4640 (comment)

unset($otherVariableTypeHolders[$variableExprString]);
}

if (count($otherVariableTypeHolders) > 0) {
Copy link
Member

Choose a reason for hiding this comment

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

Can you write a failing test against this? Or is it just about performance?

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.

3 participants