We are excited to announce that PHP 8.4 (Beta 3) is now available for testing on all SiteGround servers – well ahead of its official release date of November 21, 2024. Once again, we are among the first companies to offer PHP 8.4 (Beta 3) for testing on our hosting platform. Thanks to our unique PHP server setup, we can offer the latest PHP versions for our customers to safely test on their websites hosted with us.
Find out more about the new features brought by this latest version cambodia whatsapp number data of PHP in the next section.
What's new in PHP 8.4 (Beta 3)
This latest release introduces some very important new features that will further improve the PHP development experience. Let's dive into some of the biggest changes that PHP 8.4 (Beta 3) offers:
Property Hooks
One of the new features in PHP 8.4 (Beta 3) includes the ability to define property hooks which will eliminate the need for a lot of boilerplate code. This is one of the biggest changes in the history of PHP. Property hooks will help eliminate a lot of getters and setters by allowing each property to define its own getter and set hooks. What's more, an exciting addition is that in PHP 8.4 (Beta 3) property hooks can now be defined on interfaces.
this fairly standard class:
With PHP 8.4 (Beta 3) we can use property hooks to achieve the same result with the following syntax:
new without additional parentheses
Another new feature that will save you a lot of code is that you no longer have to wrap newly created objects in parentheses in order to chain methods on them.
Function that returns the value of the first element in the array that matches the condition. If none of the elements match the condition, the function will return `null`.
array_find_key()
Returns the key of the first element for which the callback was true. If none of the elements satisfy the condition, the function returns `null`. array_all() Checks whether the callback returns true for all elements in the array.
array_any()
Checks that the callback returns true for any of the elements in an array.
These new features make it easier to search and manipulate arrays based on custom conditions, which will overall result in cleaner, easier-to-read code.
How to test PHP 8.4 on SiteGround servers
As a SiteGround customer, you can easily test PHP 8.4 (Beta 3) on your website. Simply go to your Site Tools > Developers > PHP Manager and you can replace the current PHP version used by your site with PHP 8.4 (Beta 3) in one click.
Please note that PHP 8.4 (Beta 3) is primarily available for testing purposes, and as usual, we strongly recommend that you do not use it on your production site before its official scheduled release date (November 21, 2024).
If you need to test PHP 8.4 (Beta 3) with your existing site, we recommend that you create a new staging site and clone your production site onto it to test different things. To do this, you can use our WordPress staging tool . While you're testing, make sure nothing is failing and check your log files for any warnings or errors. Once you're done testing, you can simply delete that site.
We can take as an example
-
- Posts: 16
- Joined: Wed Dec 18, 2024 3:17 am