Skip to content

Conversation

@ondrejmirtes
Copy link
Member

No description provided.

@staabm
Copy link
Contributor

staabm commented Jan 16, 2026

applying this diff:

diff --git a/src/Analyser/LazyInternalScopeFactory.php b/src/Analyser/LazyInternalScopeFactory.php
index 611c11f598..64503833a5 100644
--- a/src/Analyser/LazyInternalScopeFactory.php
+++ b/src/Analyser/LazyInternalScopeFactory.php
@@ -59,6 +59,14 @@ final class LazyInternalScopeFactory implements InternalScopeFactory
                bool $nativeTypesPromoted = false,
        ): MutatingScope
        {
+               static $i = 0;
+               if ($i === 0) {
+                       register_shutdown_function(function () use (&$i) {
+                               var_dump($i);
+                       });
+               }
+               $i++;

I wonder why we only save very few scope creations after the MutatingScope->mergeWith(...) change.

before MutatingScope->mergeWith(...): 598562
on 4634af2 : 597376

this might also be the reason why it does not really improve performance

@staabm
Copy link
Contributor

staabm commented Jan 16, 2026

additionally I see nearly no TypeCombinator::union from within ExpressionTypeHolder->and with more than 2 types

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