.. _structures-usecasevalue: .. _use-the-case-value: Use The Case Value ++++++++++++++++++ When `switch() `_ has branched to the right case, the value of the switched variable is known : it is the case. This doesn't work with complex expression cases, nor with default. .. code-block:: php Suggestions ___________ * Use the literal value in the case, to avoid unnecessary computation. Specs _____ +--------------+-------------------------------------------------------------------------------------------------------------------------+ | Short name | Structures/UseCaseValue | +--------------+-------------------------------------------------------------------------------------------------------------------------+ | Rulesets | :ref:`All `, :ref:`Changed Behavior `, :ref:`Suggestions ` | +--------------+-------------------------------------------------------------------------------------------------------------------------+ | Exakat since | 1.9.6 | +--------------+-------------------------------------------------------------------------------------------------------------------------+ | PHP Version | All | +--------------+-------------------------------------------------------------------------------------------------------------------------+ | Severity | Minor | +--------------+-------------------------------------------------------------------------------------------------------------------------+ | Time To Fix | Quick (30 mins) | +--------------+-------------------------------------------------------------------------------------------------------------------------+ | Precision | Very high | +--------------+-------------------------------------------------------------------------------------------------------------------------+ | Available in | `Entreprise Edition `_, `Exakat Cloud `_ | +--------------+-------------------------------------------------------------------------------------------------------------------------+