Open
Description
Feature Request
There's an unhandled PHP 8.1 deprecation scenario with preg_split
that's currently not handled.
Example https://3v4l.org/cVPim
I guess we need something similar to NullToStrictStringFuncCallArgRector
but for integers.
Diff
Proposed change should be to convert the NULL
to a -1
.
$output = "a b\n\nc";
-var_dump(preg_split('/\s/', $output, NULL, PREG_SPLIT_NO_EMPTY));
+var_dump(preg_split('/\s/', $output, -1, PREG_SPLIT_NO_EMPTY));
$limit = null;
-var_dump(preg_split('/\s/', $output, $limit, PREG_SPLIT_NO_EMPTY));
+var_dump(preg_split('/\s/', $output, (int) $limit, PREG_SPLIT_NO_EMPTY));