You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
changed the title [-][php 8.4] Add array_find function upgrade rule[/-][+][php 8.4] Add array_find / array_any / array_all function upgrade rules[/+]on Jun 20, 2025
Activity
samsonasik commentedon May 12, 2025
There are other functions that exist in php 8.4:
[-][php 8.4] Add array_find function upgrade rule[/-][+][php 8.4] Add array_find / array_any / array_all function upgrade rules[/+]xHeaven commentedon Jun 21, 2025
array_find- rectorphp/rector-src#7009array_find_key- rectorphp/rector-src#7008array_any- rectorphp/rector-src#7010array_all- rectorphp/rector-src#7011Let me know if you need changes with either.
samsonasik commentedon Jun 21, 2025
Downgrade rule(s) is needed for this so new transformed to php 8.4
array_code can be downgradedhttps://github.com/rectorphp/rector-downgrade-php
xHeaven commentedon Jun 21, 2025
I didn't even know this existed - I might file a PR with the changes. 👀
samsonasik commentedon Jun 21, 2025
Awesome, after rule created, register to downgrade config set https://github.com/rectorphp/rector-downgrade-php/blob/main/config/set/downgrade-php84.php
gharlan commentedon Jun 26, 2025
ForeachToArrayFindKeyRectorreplaces code using iterable objects (instead of arrays).is replaced by:
which is invalid, because
array_find_keyonly supports arrays.Did not check the other rules.
(Note that it is not reproducible on getrector.com. But the example from
ForeachToArrayFindKeyRector.comis also not working there).samsonasik commentedon Jun 26, 2025
@gharlan php version 80400 need to be set on demo page to be able to reproduce https://getrector.com/demo/89a7b249-f374-4868-b328-30a883b833be
samsonasik commentedon Jun 26, 2025
@gharlan I created PR:
for that to skip non-array.
xHeaven commentedon Jun 26, 2025
Nice catch @gharlan, I completely forgot about the existence of iterables. Oh well. Thanks @samsonasik for the quick fix!
TomasVotruba commentedon Jun 26, 2025
Thanks everyone for quick work 💪
samsonasik commentedon Jun 26, 2025
@TomasVotruba the downgrade rules still needed, I think this can be re-open to avoid user upgrade to php 8.4, and can't downgrade to php < 8.4
github-actions commentedon Nov 28, 2025
This issue has been automatically locked because it has been closed for 150 days. Please open a new issue if you have a similar problem.