-
Notifications
You must be signed in to change notification settings - Fork 668
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Maintain loop start val after increment/decrement #10263
Maintain loop start val after increment/decrement #10263
Conversation
72a8576
to
9debd81
Compare
(Note that I've not commented on this yet because there were errors on unit tests and I assumed you were still working on it :) ) |
Yes, two steps forwards, one step back. Still working out the intricacies of the loopAnalyzer |
9debd81
to
0fea1a3
Compare
f6a556e
to
0fea1a3
Compare
@orklah the lower bound is being properly detected. I had to modify a test tests/Loop/ForTest.php |
I found these snippets: https://psalm.dev/r/303d48a67b<?php
/**
* @param list<int> $arr
*/
function cartesianProduct(array $arr) : void {
for ($i = 20; $arr[$i] === 5 && $i >= -10; $i--) {
/** @psalm-trace $i */
}
}
|
0fea1a3
to
fecc4eb
Compare
Thanks! Seems like an improvement :) |
Fixes #10213