From my knowledge of PHP and some research, as well as testing this on multiple OSs using different versions of PHP, I found the following.
Question 1 and 3:
Yes, you are right about 9 superglobal, but it is very important to remember that $ GLOBALS - Links are all variables available in the global area.
An interesting alert, note that $ GLOBALS is the only superglobal that does not start with an underscore.
Due to the fact that $ GLOBALS contains links to all other superglobals, including itself, when we print r ($ GLOBALS), it will also include other superglobals at the output. Since $ GLOBALS also refers to us, we get the RECORD that you asked about in your third paragraph. You can think of it as an infinite dimensional array containing $ GLOBALS. Almost the same idea as the infinte loop.
[GLOBALS] => Array ( [GLOBALS] => Array ( [GLOBALS] => Array ( ... ) ) )
Instead, the script sees this and stops execution and simply prints RECURSION. Now I tested it in three different environments, and every time the order in which superglobals are printed changes, but as soon as it gets into $ GLOBALS, it stops and prints RECURSION.
Question 2:
I could not find information about $_COOKIE[toWorkNormally] => 1 . I guess this is set up somewhere else. I have not seen this in any of my tests.
Question 4:
This is neither right nor wrong. The purpose of $ GLOBALS is not to store all variables created by a user worldwide. It simply refers to all the variables available globally, including superglobals. That is why you see all the other superglobals in the exit. But many developers assume that user global variables are stored in $ GLOBALS.
Description in the PHP.net manual
An associative array containing references to all the variables that are currently defined on a global scale script. The variable names are the keys of the array.
To view all the superglobals, you will need to print_r() each one individually.
To check all user-defined global variables , you can use array_keys($GLOBALS) all elements that are not superglobals are more likely to be user-defined global variables.
EDIT in response to user comments
In response to your 1st comment, no, they are not different. Superglobals not printed are still part of the array, but execution / exit stops because it gets into RECURSION when it gets into $ GLOBALS. Superglobals are printed randomly and will ever appear after $ GLOBALS is not considered, as it detects RECURSION in $ GLOBALS and stops the output.
You can check all superglobals / global variables with print_r(array_keys($GLOBALS)); Except for $ _SESSION, because the session is not already running. print_r($_SESSION) will give you an undefined variable $_SESSION notification. You will be able to see $ _SESSION when you put session_start(); immediately before printing.
Link to what is in PHP
Links in PHP are a means of accessing the same variable contents by different names.
Please note that in PHP the name of the variable and the contents of the variable are different, so the same content can have different names