It's not possible, and this is by design.
Local variables have their types inferred, and global variables don't get type checked (as they can be changed at any time from anywhere by accesing $_GLOBALS
).
If there's a particular page of the documentation that could make this clearer, please click the "File A Documentation Bug" link at the bottom of it, so it can be added.