.. _structures-sgvariablesconfusion: .. _static-global-variables-confusion: Static Global Variables Confusion +++++++++++++++++++++++++++++++++ PHP can't have variable that are both `static `_ and global variable. While the syntax is legit, the variables will be alternatively global or `static `_. It is recommended to avoid using the same name for a global variable and a `static `_ variable. .. code-block:: php Connex PHP features ------------------- + `global `_ + `static `_ Suggestions ___________ * Avoid using static variables * Avoid using global variables * Avoid using the same name for static and global variables Specs _____ +--------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Short name | Structures/SGVariablesConfusion | +--------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Rulesets | :ref:`All `, :ref:`Changed Behavior `, :ref:`Semantics `, :ref:`Suggestions ` | +--------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Exakat since | 2.1.2 | +--------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+ | PHP Version | All | +--------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Severity | Minor | +--------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Time To Fix | Quick (30 mins) | +--------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Precision | Very high | +--------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Available in | `Entreprise Edition `_, `Exakat Cloud `_ | +--------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+