.. _php-neverkeyword: .. _never-keyword: Never Keyword +++++++++++++ Never becomes a PHP keyword. It is used for typing functions which never returns anything (either dies or throw an `exception) `_. It should be avoided in namespaces, classes, traits and interfaces. Methods, constants and functions are OK. .. code-block:: php See also `never `_ and `PHP RFC: noreturn type `_. Related PHP errors ------------------- + `0 `_ Connex PHP features ------------------- + `never `_ Suggestions ___________ * Rename the classes, traits and interfaces with a different name. Specs _____ +------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Short name | Php/NeverKeyword | +------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Rulesets | :ref:`All `, :ref:`Analyze `, :ref:`Appinfo `, :ref:`Changed Behavior `, :ref:`CompatibilityPHP81 ` | +------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Exakat since | 2.3.0 | +------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | PHP Version | With PHP 8.1 and older | +------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Severity | Major | +------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Time To Fix | Slow (1 hour) | +------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Changed Behavior | PHP 8.1 - `More `__ | +------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Precision | Very high | +------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Available in | `Entreprise Edition `_, `Exakat Cloud `_ | +------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+