Add regression test for array self-append #3715
Merged
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.
Closes phpstan/phpstan#6948
This is using the example that @staabm used in that issue as well. If I double the cases it gets just a tiny bit slower, but not much. it seems to be linear instead of exponential now. I can add cases until at some point xdebug starts detecting endless recursions, but that's another issue I guess 😁 so I think the original case of "exponential slowdown" has really been properly fixed.
For the record as already mentioned, this was somewhere massively improved between these commits: a07996a, 1a0099d, 53a1554, 537c12c, c04555b, 4dfbe16
c04555b stood out via git bisect and improved it initially, which surprised me, but reverting it on 1.12.x does not bring the issue back, so the situation is somewhat more complex I suppose and there might be something else later that also fixes or improves this in combination.