With the RFC restrict_globals_usage the way of how MediaWIki's GLobalConfigBuilder operates is not supported anymore. It is now not possible to use $GLOBALS by reference, which results in the following error message in PHP 8.1:
PHP Fatal error: Cannot acquire reference to $GLOBALS in /data/mediawiki/main/includes/Settings/Config/GlobalConfigBuilder.php on line 20
The relevant code is:
$this->config = &$GLOBALS;