That's a confusing question. If we make all non-local variables automatically accessible in all functions by default, thereby making the top-level scope "just another scope" and removing the need to distinguish between "global variables" and "super-global variables", is that removing
super-globals or keeping
them? All global variables would be super-global, but we would not be using that term anymore.
It is not super-globals that are special, but non-super
globals. Super-global and local variables do not need to be declared in each enclosing scope; they are automatically accessible, like functions and labels. Only non-super globals require re-declaration inside a function (unless you use assume-global).
Similarly (and maybe not a coincidence), variable references inside PHP functions are local by default, and the global
keyword must be used to make global variables accessible.
You may notice that this is a little bit different from the C language in that global variables in C are automatically available to functions unless specifically overridden by a local definition. This can cause some problems in that people may inadvertently change a global variable. In PHP global variables must be declared global inside a function if they are going to be used in that function.
Source: PHP: Variable scope - Manual
Like AutoHotkey, PHP's built-in
variables are always available in all scopes. PHP describes them as "superglobal", but doesn't offer a way to create more of them.
Notice that the explanation in the PHP manual refers only to changing
a global variable. Python solves that in a different way:
In Python, variables that are only referenced inside a function are implicitly global. If a variable is assigned a value anywhere within the function’s body, it’s assumed to be a local unless explicitly declared as global.
Though a bit surprising at first, a moment’s consideration explains this. On one hand, requiring global for assigned variables provides a bar against unintended side-effects. On the other hand, if global was required for all global references, you’d be using global all the time. You’d have to declare as global every reference to a built-in function or to a component of an imported module. This clutter would defeat the usefulness of the global declaration for identifying side-effects.
Source: Programming FAQ — Python 3.8.0 documentation
Without an assignment, having a function access a global variable when an empty local variable was expected doesn't seem like much of an issue, because it implies that the variable is being used without being initialized. However, 1) explicit initialization is optional, and 2) a variable can be initialized by passing it to a function ByRef.
lua-users wiki: Local By Default
(contains various quotes)
Why not "local by default".