.. _php-assertfunctionisreserved: .. _assert-function-is-reserved: Assert Function Is Reserved +++++++++++++++++++++++++++ Avoid defining an ``assert`` function in namespaces. While they work fine when the assertions are active (``zend.assertions=1``), calls to unqualified ``assert`` are optimized away when assertions are not active. Since PHP 7.3, a fatal `error `_ is emitted : ``Defining a custom `assert() `_ function is deprecated, as the function has special semantics``. .. code-block:: php See also `assert `_ and `User-defined assert function is optimized away with zend.assertions=-1 `_. Related PHP errors ------------------- + `0 `_ Connex PHP features ------------------- + `assertion `_ Suggestions ___________ * Rename the custom function with another name Specs _____ +------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Short name | Php/AssertFunctionIsReserved | +------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Rulesets | :ref:`All `, :ref:`Analyze `, :ref:`Changed Behavior `, :ref:`CompatibilityPHP73 `, :ref:`Deprecated ` | +------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Exakat since | 1.3.9 | +------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | PHP Version | All | +------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Severity | Critical | +------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Time To Fix | Slow (1 hour) | +------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Changed Behavior | PHP 7.2 - `More `__ | +------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Precision | Very high | +------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Available in | `Entreprise Edition `_, `Exakat Cloud `_ | +------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+