.. _php-compactinexistant: .. _nonexistent-variable-in-compact(): Nonexistent Variable In compact() +++++++++++++++++++++++++++++++++ `Compact() `_ doesn't warn when it tries to work on an nonexistent variable. It just ignores the variable. This behavior changed in PHP 7.3, and `compact() `_ now emits a warning when the compacted variable doesn't exist. For performances reasons, this analysis only works inside methods and functions. .. code-block:: php See also `compact `_ and `PHP RFC: Make compact function reports undefined passed variables `_. Related PHP errors ------------------- + `Undefined variable $a `_ Connex PHP features ------------------- + `compact `_ Suggestions ___________ * Fix the name of variable in the compact() argument list * Remove the name of variable in the compact() argument list Specs _____ +--------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Short name | Php/CompactInexistant | +--------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Rulesets | :ref:`All `, :ref:`Changed Behavior `, :ref:`CompatibilityPHP73 `, :ref:`Suggestions ` | +--------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Exakat since | 1.2.9 | +--------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | PHP Version | All | +--------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Severity | Major | +--------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Time To Fix | Quick (30 mins) | +--------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Precision | High | +--------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Available in | `Entreprise Edition `_, `Exakat Cloud `_ | +--------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+