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

     {
     	$string = 'keys=1000';
         
-        $this->assertSame(1, preg_match('/^keys=(?P<count>\d+)/', $string, $matches));
+        $this->assertRegExp('/^keys=(?P<count>\d+)/', $string);
         $this->assertSame(1000, (int) $matches['count']);
     }
 }
PHP snippet to change

Applied Rules:

Not a change you expect?

Config  rector.php
Rector version: f84027 - released at 2026-07-15 19:02