.. _php-scalartypehintusage: .. _scalar-typehint-usage: Scalar Typehint Usage +++++++++++++++++++++ Spot usage of scalar type hint : ``int``, ``float``, ``boolean`` and ``string``. Scalar typehint are PHP 7.0 and more recent. Some, like ``object``, is 7.2. Scalar typehint were not supported in PHP 5 and older. Then, the typehint is treated as a class name. .. code-block:: php See also `PHP RFC: Scalar Type Hints `_ and `Type declarations `_. Connex PHP features ------------------- + `scalar-typehint `_ + `typehint `_ Specs _____ +------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Short name | Php/ScalarTypehintUsage | +------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Rulesets | :ref:`All `, :ref:`Appinfo `, :ref:`CE `, :ref:`Changed Behavior ` | +------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Exakat since | 0.8.4 | +------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | PHP Version | With PHP 7.0 and more recent | +------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Severity | Major | +------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Time To Fix | Quick (30 mins) | +------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Changed Behavior | PHP 7.0 - `More `__ | +------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Precision | Very high | +------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Available in | `Entreprise Edition `_, `Community Edition `_, `Exakat Cloud `_ | +------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+