We can be more clear with the extension of the given example.
Before PHP Version 8.1
<?php
$a = 1;
$globals = $GLOBALS;
$globals['a'] = 2;
echo $a; // 2
echo $globals['a']; // 2
echo $GLOBALS['a']; // 2
?>
After PHP Version 8.1
<?php
$a = 1;
$globals = $GLOBALS;
$globals['a'] = 2;
echo $a; // 1
echo $globals['a']; // 2
echo $GLOBALS['a']; // 1
?>