.. _classes-unreachableconstant: .. _unreachable-class-constant: Unreachable Class Constant ++++++++++++++++++++++++++ Class constants may be unreachable due to visibility configuration. Since PHP 7.1, class constants support visibility. Their usage may be restricted to the current class, or ``private``, to classes that extends or are extended by the current class, or ``protected``. They may also be ``public``, just like it was before. .. code-block:: php See also `Class Constant `_ and `PHP RFC: Support Class Constant Visibility `_. Related PHP errors ------------------- + `0 `_ Connex PHP features ------------------- + `class `_ Suggestions ___________ * Make the class constant protected, when the call to the constant is inside a related class. * Create another constant, that may be accessible * Make the class constant public Specs _____ +--------------+--------------------------------------------------------------------------------------------------------------------------+ | Short name | Classes/UnreachableConstant | +--------------+--------------------------------------------------------------------------------------------------------------------------+ | Rulesets | :ref:`All `, :ref:`Changed Behavior `, :ref:`Class Review ` | +--------------+--------------------------------------------------------------------------------------------------------------------------+ | Exakat since | 1.5.4 | +--------------+--------------------------------------------------------------------------------------------------------------------------+ | PHP Version | All | +--------------+--------------------------------------------------------------------------------------------------------------------------+ | Severity | Major | +--------------+--------------------------------------------------------------------------------------------------------------------------+ | Time To Fix | Slow (1 hour) | +--------------+--------------------------------------------------------------------------------------------------------------------------+ | Precision | Very high | +--------------+--------------------------------------------------------------------------------------------------------------------------+ | Available in | `Entreprise Edition `_, `Exakat Cloud `_ | +--------------+--------------------------------------------------------------------------------------------------------------------------+