$$(双美元)在mysql的上下文中服务的目的是什么? [重复]

I am using old code for a login process that accesses a local database. This is the first web project that I would like to put online. The code that I started with had deprecated functions so I've been trying to get everything up and running and gain an understanding of the language/process.

The original developers used a variable $link and two lines later they declare a global $$link. (EDIT: Since I first posted I learned about a variable variable, but I still fully understand this use case. What could it be used for)

tep_db_connect() or die('Unable to connect to database server!');
function tep_db_connect($server = DB_SERVER, $username = DB_SERVER_USERNAME, $password = DB_SERVER_PASSWORD, $database = DB_DATABASE, $link = 'db_link')
{
  global $$link;

  $$link = new mysqli($server, $username, $password);

  if (!$$link) {
  die("Connection Failed: " . $mysqli_connect_error());
  }

 mysqli_select_db($$link, $database);
 return $$link;

}

This is my first web project. I'm used to using a debugger to figure things out.

</div>

I believe this can be considered "meta" programming, but as has been mentioned, this is a variable variable. An example to illustrate may be:

$a = '1';
$b = 'a';
echo $$b; // result: 1, can effectively be read as ${$b} -> ${a} -> $a
echo ${$b}; // same as above but a bit more obvious