Skip to content

[Php81] Add NullToStrictIntPregSlitFuncCallLimitArgRector#7240

Merged
TomasVotruba merged 7 commits intomainfrom
php81-null-strict-int
Sep 11, 2025
Merged

[Php81] Add NullToStrictIntPregSlitFuncCallLimitArgRector#7240
TomasVotruba merged 7 commits intomainfrom
php81-null-strict-int

Conversation

@samsonasik
Copy link
Member

@samsonasik samsonasik commented Sep 11, 2025

Add rule to convert:

-        preg_split('/\s/', $output, NULL, PREG_SPLIT_NO_EMPTY);
+        preg_split('/\s/', $output, 0, PREG_SPLIT_NO_EMPTY);

The logic is shared with same converter and renamed to NullToStrictStringIntConverter that allow to convert for int purpose.

Fixes rectorphp/rector#9160

@samsonasik
Copy link
Member Author

All checks have passed 🎉 @TomasVotruba it is ready for review.

@TomasVotruba TomasVotruba merged commit 667de49 into main Sep 11, 2025
49 checks passed
@TomasVotruba TomasVotruba deleted the php81-null-strict-int branch September 11, 2025 06:21
@TomasVotruba
Copy link
Member

Looks good 👍 thank you

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.

[php 8.1] preg_split(): Passing null to parameter #3 ($limit) of type int is deprecated

2 participants