What is the difference between $HTTP_REFERER and $_SERVER['HTTP_REFERER'] in PHP?

$HTTP_REFERER is a deprecated variable in PHP that was used to retrieve the referring URL of a page. $_SERVER['HTTP_REFERER'] is the current recommended way to access the referring URL in PHP. To ensure compatibility and future-proof your code, it is recommended to use $_SERVER['HTTP_REFERER'] instead of $HTTP_REFERER.

$referer = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '';
echo $referer;