We are excited to announce that Smarthost has deployed the latest version of PHP 8.4 on its servers! We remain committed to providing you with access to the latest technologies, which enhance performance and improve security.In this post, we’ll highlight the key new features and changes introduced in PHP 8.4, as well as how they compare to the previous version.
Key Changes in PHP 8.4:
Property Hooks
A new feature that simplifies access to and modification of protected and private class properties. This eliminates the need for getters and setters, as you can now define custom hooks directly.
Asymmetric Visibility
Allows for defining different access levels for reading and writing class properties. This feature enhances security and control over data access in your code.
New Syntax for new MyClass()->method()
You can now create an object and invoke its method directly in a single statement.
Exit and Die as Functions
These constructs now function as full-fledged functions with support for:
- Named arguments
- Strict typing (
strict_types
)
Additional New Features and Improvements:
- Introduction of the
#[\Deprecated]
attribute to mark deprecated code elements. - New functions:
mb_ucfirst
,mb_lcfirst
,mb_trim
, and their equivalents for multibyte string handling. - The ability to split symbols using the
grapheme_str_split()
function. - Added the
request_parse_body()
function for handling HTTP requests. - OpenSSL update now requires version 1.1.1.
- The
BcMath\Number
class allows for the use of mathematical operators on objects.
Deprecated Functions and Changes in PHP 8.4:
- Removal of Implicit Nullable Types – to assign
null
, the?
prefix must now be used. - The system has deprecated the functions mysqli_ping() and mysqli_refresh().
- GMP class no longer extendable – it is now considered final.
Why Upgrade to PHP 8.4?
- Faster Performance – reduce application load times by 5-10%.
- Modern Solutions – new features and types expand developers’ capabilities.
- Enhanced Security – reduced risk of vulnerabilities.
- Better Framework Support – PHP 8.4 introduces improvements that may ease the support of frameworks and libraries, as long as developers update their code for the new version.
How to Change PHP Version on Smarthost Servers?
Changing the PHP version on Smarthost servers is incredibly simple. Just follow these steps:
- Log in to cPanel.
- Go to MultiPHP Manager.
- Select the domain and choose PHP 8.4 from the list of available versions.
- Confirm the changes.
If you encounter any issues, our Technical Support team is available 24/7!
Thank you for choosing Smarthost – we work hard to keep you ahead of the competition. We encourage you to update your PHP environment today and take advantage of all the new features offered by PHP 8.4!
- What’s New in PHP 8.4? - January 7, 2025
- What is the WooCommerce Plugin? - December 5, 2024
- Winter with WooCommerce at Smarthost - December 3, 2024