.. _php-newinitializers: .. _new-initializers: New Initializers ++++++++++++++++ Parameters, `static `_ variables and global constants may be initialized with an object. This feature is available in PHP 8.1 and more recent. It is reported as an invalid constant expression in older PHP versions. .. code-block:: php See also `PHP RFC: New in initializers `_ and `Nested Attributes`_. Related PHP errors ------------------- + `0 `_ Connex PHP features ------------------- + `new-in-initializer `_ + `nested-attribute `_ Specs _____ +--------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Short name | Php/NewInitializers | +--------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Rulesets | :ref:`All `, :ref:`Appinfo `, :ref:`Changed Behavior `, :ref:`CompatibilityPHP73 `, :ref:`CompatibilityPHP74 `, :ref:`CompatibilityPHP80 ` | +--------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Exakat since | 2.3.1 | +--------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | PHP Version | With PHP 8.1 and more recent | +--------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Severity | Minor | +--------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Time To Fix | Quick (30 mins) | +--------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Precision | Very high | +--------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Available in | `Entreprise Edition `_, `Exakat Cloud `_ | +--------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+