Is it necessary to define $PHP_SELF as global in PHP scripts?

It is not necessary to define $PHP_SELF as global in PHP scripts. $PHP_SELF is a predefined variable in PHP that contains the filename of the currently executing script. It is automatically available in all scopes of the script without the need to declare it as global.

// No need to define $PHP_SELF as global
echo $_SERVER['PHP_SELF'];