.. _performances-issetwholearray: .. _isset()-on-the-whole-array: Isset() On The Whole Array ++++++++++++++++++++++++++ `Isset() `_ works quietly on a whole array. There is no need to test all previous index before testing for the target index. It also works on chained properties. There is a gain in readability, by avoiding long and hard to read logical expression, and reducing them in one simple `isset() `_ call. There is a gain in performances by using one call to `isset() `_, instead of several. It is a micro-optimization. .. code-block:: php p1) && isset($object->p1->property)) { // Do something with $object->p1->property } ?> See also `Isset `_. Connex PHP features ------------------- + `coalesce `_ + `isset `_ Suggestions ___________ * Merge all calls in one, and remove all unnecessary calls to isset() Specs _____ +--------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Short name | Performances/IssetWholeArray | +--------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Rulesets | :ref:`All `, :ref:`Changed Behavior `, :ref:`Performances `, :ref:`Suggestions ` | +--------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Exakat since | 1.5.6 | +--------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | PHP Version | All | +--------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Severity | Minor | +--------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Time To Fix | Instant (5 mins) | +--------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Precision | High | +--------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Examples | :ref:`case-tine20-performances-issetwholearray`, :ref:`case-expressionengine-performances-issetwholearray` | +--------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Available in | `Entreprise Edition `_, `Exakat Cloud `_ | +--------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------+