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

The difference between $PHP_SELF and $_SERVER['PHP_SELF'] in PHP forms is that $PHP_SELF is a variable that was used in older versions of PHP to refer to the current script file name, while $_SERVER['PHP_SELF'] is a superglobal variable that contains the same information. It is recommended to use $_SERVER['PHP_SELF'] as it is more secure and reliable.

<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
    <!-- form fields go here -->
</form>