.. _structures-uselessglobal: .. _useless-global: Useless Global ++++++++++++++ Global are useless in two cases. First, on super-globals, which are always globals, like `$_GET `_; secondly, on variables that are not used. Also, PHP has superglobals, a special team of variables that are always available, whatever the context. They are : $GLOBALS, $_SERVER, `$_GET `_, `$_POST `_, $_FILES, $_COOKIE, $_SESSION, `$_REQUEST `_ and `$_ENV `_. .. code-block:: php Connex PHP features ------------------- + `super-global `_ + `$_get `_ + `$_post `_ + `$_server `_ + `$globals `_ + `$_files `_ + `$_cookie `_ + `$_request `_ + `$_env `_ Suggestions ___________ * Drop the global expression Specs _____ +--------------+-------------------------------------------------------------------------------------------------------------------------+ | Short name | Structures/UselessGlobal | +--------------+-------------------------------------------------------------------------------------------------------------------------+ | Rulesets | :ref:`All `, :ref:`Analyze `, :ref:`Changed Behavior ` | +--------------+-------------------------------------------------------------------------------------------------------------------------+ | Exakat since | 0.8.4 | +--------------+-------------------------------------------------------------------------------------------------------------------------+ | PHP Version | All | +--------------+-------------------------------------------------------------------------------------------------------------------------+ | Severity | Minor | +--------------+-------------------------------------------------------------------------------------------------------------------------+ | Time To Fix | Quick (30 mins) | +--------------+-------------------------------------------------------------------------------------------------------------------------+ | Precision | Very high | +--------------+-------------------------------------------------------------------------------------------------------------------------+ | Examples | :ref:`case-zencart-structures-uselessglobal`, :ref:`case-humo-gen-structures-uselessglobal` | +--------------+-------------------------------------------------------------------------------------------------------------------------+ | Available in | `Entreprise Edition `_, `Exakat Cloud `_ | +--------------+-------------------------------------------------------------------------------------------------------------------------+