Run Rector on your code to see what it can do for you:

 
 var_dump(preg_match('#[0-9]+#u', '1'));
 var_dump(preg_match('#[\d]+#u', '1'));
-var_dump(preg_match('#[0-9]+#', '1'));
+var_dump(preg_match('#\d+#', '1'));
 var_dump(preg_match('#[\d]+#', '1'));
PHP snippet to change

Applied Rules:

Not a change you expect?

Config  rector.php
Rector version: 3bc3c8 - released at 2025-06-25 16:55