private function getGlobal(string $global, string $name)
    {
        if (!isset($GLOBALS[$global]) // Global does not exist
            || !is_array($GLOBALS[$global]) // Global is not an array
            || ($name && !isset($GLOBALS[$global][$name])) // Global variable does not exist
        ) {
            return null;
        }
        if (!$name) {
            return $GLOBALS[$global]; // return entire Global array
        }

        return $GLOBALS[$global][$name]; // return requested Global variable
    }
private function getGlobal(string $global, string $name)
    {
        if (!isset($GLOBALS[$global]) // Global does not exist
            || !is_array($GLOBALS[$global]) // Global is not an array
            || ($name && !isset($GLOBALS[$global][$name])) // Global variable does not exist
        ) {
            return null;
        }
        if (!$name) {
            return $GLOBALS[$global]; // return entire Global array
        }

        return $GLOBALS[$global][$name]; // return requested Global variable
    }
private function getGlobal ( string $ global , string $ name ) { if ( ! isset ( $ GLOBALS [ $ global ] ) // Global does not exist || ! is_array ( $ GLOBALS [ $ global ] ) // Global is not an array || ( $ name && ! isset ( $ GLOBALS [ $ global ] [ $ name ] ) ) // Global variable does not exist ) { return null ; } if ( ! $ name ) { return $ GLOBALS [ $ global ] ; // return entire Global array } return $ GLOBALS [ $ global ] [ $ name ] ; // return requested Global variable }
get a value from a global array, or the whole global array

@param string $global
@param string $name
@return array|null|string
get a value from a global array or the whole global array