.. _php-classfunctionconfusion: .. _class-function-confusion: Class Function Confusion ++++++++++++++++++++++++ Avoid classes and functions bearing the same name. When functions and classes bear the same name, calling them may be confusing. This may also lead to forgotten 'new' keyword. .. code-block:: php Connex PHP features ------------------- + `function `_ + `class `_ Suggestions ___________ * Use a naming convention to distinguish functions and classes * Rename the class or the function (or both) * Use an alias with a `use` expression Specs _____ +--------------+-------------------------------------------------------------------------------------------------------------------------+ | Short name | Php/ClassFunctionConfusion | +--------------+-------------------------------------------------------------------------------------------------------------------------+ | Rulesets | :ref:`All `, :ref:`Changed Behavior `, :ref:`Semantics ` | +--------------+-------------------------------------------------------------------------------------------------------------------------+ | Exakat since | 0.10.2 | +--------------+-------------------------------------------------------------------------------------------------------------------------+ | PHP Version | All | +--------------+-------------------------------------------------------------------------------------------------------------------------+ | Severity | Minor | +--------------+-------------------------------------------------------------------------------------------------------------------------+ | Time To Fix | Slow (1 hour) | +--------------+-------------------------------------------------------------------------------------------------------------------------+ | Precision | Very high | +--------------+-------------------------------------------------------------------------------------------------------------------------+ | Available in | `Entreprise Edition `_, `Exakat Cloud `_ | +--------------+-------------------------------------------------------------------------------------------------------------------------+