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

     {
         $function = fn (): string => 'something';
         
-        self::assertSame(1, preg_match('/^.+__o__[0-9A-Fa-f]+__s\d+$/', $function()));
+        self::assertRegExp('/^.+__o__[0-9A-Fa-f]+__s\d+$/', $function());
     }
 }
PHP snippet to change

Applied Rules:

Not a change you expect?

Config  rector.php
Rector version: 68156b - released at 2026-03-29 00:56