Create merge conditionals from the differing holders only - #6141
Merged
Conversation
The loop array rewrite filled $keyLoopNativeTypes with the same getType() reads as the PHPDoc list, so a key-type-changing loop mapped the native array's key type to the PHPDoc key union. Latent in practice - the native mapping is guarded behind keyTypeChanged and a mappable native array - but the flavour was plainly wrong. Also drops an unused variable left behind by the for-loop condition conversion. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019wqGgaD7iqL44t1KgpJS7b
createConditionalExpressions() scanned every holder map in full - twice per merge - although each of its loops only ever selects entries whose our/their/merged holders differ. mergeVariableHolders() knows exactly which keys those are and now reports them; the conditional creation iterates just that diff - typically a handful of keys instead of hundreds of holders. The ScopeOps turbo twin mirrors both signature changes. createConditionalExpressions was the largest self-time item in the single-pass branch's SPX profile; make phpstan user CPU measured -2..5% here. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019wqGgaD7iqL44t1KgpJS7b
ondrejmirtes
force-pushed
the
analyser-cleanups
branch
from
July 28, 2026 18:24
07009d8 to
3f94c39
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two analyser cleanups extracted from the
resolve-type-rewrite-2branch (independent PR on 2.2.x).createConditionalExpressions()scanned every holder map in full — twice per merge — although its loops only ever select entries whose our/their/merged holders differ.mergeVariableHolders()now reports those keys by reference and the conditional creation iterates just that diff. This was the largest self-time item in the branch's SPX profile; local ABAB pairs here show ~2–5%make phpstanuser-CPU improvement. TheScopeOpsturbo twin mirrors both signature changes (by-ref out-parameter included), with differential smoke coverage; analysis output is byte-identical with the extension on vsPHPSTAN_TURBO=0.$keyLoopNativeTypeswas filled with the samegetType()reads as the PHPDoc list, so a key-type-changing loop mapped the native array's key type to the PHPDoc key union. Latent in practice (the mapping is guarded behindkeyTypeChangedand a mappable native array — no observable fixture found, and the branch shares the same line), but the flavour was plainly wrong.⚠ Merge note: this PR touches
turbo-ext/src, so the version-pin commit is included — if the merge rebases the commits, re-runmake bump-turboon 2.2.x afterwards.Validation: full test suite green with and without the turbo extension (17776 each), smoke + method/signature parity green, self-analysis clean, code style clean.
🤖 Generated with Claude Code
https://claude.ai/code/session_019wqGgaD7iqL44t1KgpJS7b