It seems to me that in the context of regexp replacements 4 backslashes are preferred over 3 backslashes.
https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Math/+/826932
However, there are some instances of 3 backslashes in core.
$class = preg_replace( '#^Wikimedia\\\Rdbms\\\#', '', get_class( $exception ) );
$class = preg_replace( '#^Wikimedia\\\Rdbms\\\#', '', get_class( $e ) );
Now my question is:
- Are there good reasons for 3 backslashes?
- Should we replace the existing instances of 3 backslashes with 4 backslashes?