January 20th 2024

Announcement

Feature Request

Improved

Introduction of PHP 8.2 and 8.3

We are excited to announce the addition of PHP versions 8.2 and 8.3 to the 'Select PHP Version' interface on all our cPanel and DirectAdmin servers. This significant update reflects our commitment to offering the latest technology advancements and performance improvements to our valued users.

New Features in PHP 8.2:

  1. Type System Enhancements: It now supports true, false, and null as standalone types, and Disjunctive Normal Form (DNF) types, allowing for more precise and expressive type declarations.

  2. Readonly Classes: Building on readonly properties from PHP 8.1, PHP 8.2 introduces readonly classes. In these classes, all properties are automatically readonly, enhancing immutability.

  3. New Random Extension: This refactors RNG functionality into a new extension, maintaining existing functions while adding an OOP API for more secure and testable applications.

  4. Constants in Traits: PHP 8.2 allows the declaration of constants in traits, which become class constants when a class uses the trait.

  5. Sensitive Parameter Value Redaction: A new built-in parameter attribute #[\SensitiveParameter] redacts sensitive information in stack traces and error messages.

  6. New Functions and Classes: There are several new functions and classes, such as ini_parse_quantity for parsing INI quantity values, curl_upkeep to maintain Curl connections, and openssl_cipher_key_length for cipher key length retrieval.

Additionally, PHP 8.2 deprecates certain features like dynamic properties, the utf8_encode and utf8_decode functions, and ${var} string interpolation.

New Features in PHP 8.3:


PHP 8.3 introduces several new features and changes. Key highlights include:

  1. Typed Class Constants: Allows type declarations for class constants.

  2. New Functions: Such as json_validate for JSON validation and mb_str_pad for string padding.

  3. Enhancements in Random Extension: New methods for floating-point number generation and byte extraction from strings.

  4. Dynamic Class Constant and Enum Member Fetch Support: Improves flexibility in class constant and enum member usage.

  5. New #[\Override] Attribute: Enforces method overriding checks.

  6. Additional GC Information in gc_status(): Offers more detailed garbage collection data.

  7. Granular DateTime Exceptions and changes in PHP extension class constants.

The release also deprecates certain functionalities like get_class() without arguments and aspects of the assert function. For comprehensive details, it is best to refer to the PHP 8.3 page on PHP.Watch.

Deprecated Features Notice:

It's important to note that with new versions come deprecations. We advise checking the official PHP documentation for a detailed list of deprecated features. This will help you in updating and preparing your applications for a smooth transition.

WordPress Performance Benchmarks:

  • Tested versions: WordPress 6.4.2 and 6.2.2.

  • Tested URL: /

  • Size: 84,257,000 bytes (WordPress 6.4.2); 52,684,000 bytes (WordPress 6.2.2).

  • Results for WordPress 6.4.2:

    • PHP 7.4: 149 res/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 res/s.

    • PHP 8.1: 151 req/s.

    • PHP 8.2: 153 req/s.

    • PHP 8.3: 165 req/s.

How do I change my PHP Version?

To change the PHP version of a site using the 'Select PHP Version' screen in cPanel or DirectAdmin, follow these steps:

  1. Log into cPanel or DirectAdmin: 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.

  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 are also able to revert to the previous version in use.

Type @ to mention posts