Introduction of PHP 8.2 and 8.3

 Monday, January 22, 2024

We are pleased to announce the integration of PHP versions 8.2 and 8.3 into the 'Select PHP Version' interface across all our cPanel servers. This substantial update underscores our dedication to providing our esteemed users with the latest technological advancements and performance enhancements.

New Features in PHP 8.2:

  1. Type System Enhancements:

    • Supports true, false, and null as standalone types.
    • Introduces Disjunctive Normal Form (DNF) types for more precise type declarations.
  2. Readonly Classes:

    • Extends read-only properties from PHP 8.1 to introduce read-only classes, enhancing immutability.
  3. New Random Extension:

    • Refactors RNG functionality into a new extension, maintaining existing functions while adding an OOP API.
  4. Constants in Traits:

    • Allows declaration of constants in traits, becoming class constants when a class uses the trait.
  5. Sensitive Parameter Value Redaction:

    • Introduces a new built-in parameter attribute #[\SensitiveParameter] for redacting sensitive information in stack traces and error messages.
  6. New Functions and Classes:

    • Includes functions like ini_parse_quantity, curl_upkeep, and openssl_cipher_key_length.
  7. Deprecations:

    • Deprecates dynamic properties, utf8_encode and utf8_decode functions, and ${var} string interpolation.

New Features in PHP 8.3:

  • Typed Class Constants:
    • Allows type declarations for class constants.
  • New Functions:
    • Introduces json_validate for JSON validation and mb_str_pad for string padding.
  • Enhancements in Random Extension:
    • Adds new methods for floating-point number generation and byte extraction from strings.
  • Dynamic Class Constant and Enum Member Fetch Support:
    • Improves flexibility in class constant and enum member usage.
  • New #[\Override] Attribute:
    • Enforces method overriding checks.
  • Additional GC Information in gc_status():
    • Offers more detailed garbage collection data.
  • Granular DateTime Exceptions and changes in PHP extension class constants.
    • Various improvements and changes.

Deprecated Features Notice: With new versions come deprecations. Please check the official PHP documentation for a detailed list of deprecated features to ensure a smooth transition for your applications.

WordPress Performance Benchmarks:

  • Tested versions: WordPress 6.4.2 and 6.2.2.
    • Results for WordPress 6.4.2:
      • PHP 7.4: 149 req/s.
      • PHP 8.1: 153 req/s.
      • PHP 8.2: 158 req/s.
      • PHP 8.3: 169 req/s.
    • Results for WordPress 6.2.2:
      • PHP 7.4: 147 req/s.
      • PHP 8.1: 151 req/s.
      • PHP 8.2: 153 req/s.
      • PHP 8.3: 165 req/s.

How to Change PHP Version:

  1. Log into cPanel:
    • Use your credentials to access the hosting control panel.
  2. Navigate to PHP Version Selector:
    • Look for the 'Select PHP Version' or similar option.
  3. Select the Domain:
    • If you have multiple domains, choose the one you want to change the PHP version for.
  4. Choose the PHP Version:
    • Select the new PHP version (e.g., PHP 8.2 or 8.3) from the list.
    • PHP selector
  5. Apply Changes:
    • Save or apply the changes to update the PHP version for the selected domain.

It's crucial to test your website for compatibility with the new PHP version, and if you encounter any errors, you can revert to the previous version in use.

Powered by WHMCompleteSolution